Dates again ...
The only way I have ever got dates working via the BDE is to use Parameters eg 
ParamByName('MyDate").AsDateTime := Now() , I have never had success with putting date 
literals into the SQL statements (then if I got any error always reverted to using 
parameters).

Beware when using Parameters as to whether you need to use ParamByName().AsDate or 
AsDateTime - you may find only one of these will work eg Normal only AsDateTime.
Myles.


-----Original Message-----
From:   Patrick Dunford [SMTP:[EMAIL PROTECTED]]
Sent:   Thursday, July 01, 1999 11:23 AM
To:     Multiple recipients of list delphi
Subject:        RE: [DUG]:  Paradox Date Format Trouble



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Tony Sinclair
> Sent: Thursday, 1 July 1999 09:56
> To: Multiple recipients of list delphi
> Subject: [DUG]: Paradox Date Format Trouble
>
>
> Hi all,
>
> I am currently having trouble with a simple SQL script that a TSQL just
> doesn't want to accept.  I have followed the date format in the
> localsql.hlp file but I keep getting an invalid format message.
>
> SQL.Add('SELECT SH.Terminal, Sum(SH.Invoice) AS TotalSale,
> SH.SaleType');
> SQL.Add('FROM SaleHeader.db SH');
> SQL.Add('WHERE (SH.SaleType = ' + IntToStr(intCount) + ') AND
> (SH.SaleDate BETWEEN "' + convertDateToUS(ReportsForm.FromDate.DateTime)

snip

My recollection from running the Database Explorer and doing a query in the
SQL window, is that literal dates need to be in quotes. Does this apply to
your situation?

============================================
Patrick Dunford, Christchurch, NZ
http://patrick.dunford.com/
http://www.trainweb.org/enzedrail/

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

application/ms-tnef

Reply via email to