Re: Sql Date Question




Can you use
Add(' where apptdate between ' + QuotedStr(FormatDateTime('mm"/"dd"/"yyyy',
FromDate)));
Add(' and ' + QuotedStr(FormatDateTime('mm"/"dd"/"yyyy', ToDate)));
Add(' Order by LeadNo');

And you would need a space after Table1' or before the 'Where and before the
Order statement.



"John" <johnpk1946@xxxxxxxxx> wrote in message
news:4561e905$2@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi
Add('Select * from Table1');
Add('Where APPTDATE >= ' +
QuotedStr(FormatDateTime('mm"/"dd"/"yyyy', FromDate)));
Add(' AND APPTDATE <= ' +
QuotedStr(FormatDateTime('mm"/"dd"/"yyyy', ToDate)));
Add('Order by LeadNo');
The above sql stmt works find if the from & to dates are within the
same
year but not if the years is different. The table will have many yeats on
it.
Something is amiss but I can't figure it out.

Thanks
John




.