Hi

I could not find any simple DatePart function in MSSQL to extract date
portion from datetime columns.
What is the best way to compare dates with the values in the datetime column
ignoring its time portion ?

I found this working but a bit ugly:

Say I want records from 1/05/2000 to 30/05/2000 and my logged column is of
datetime type.

SELECT * FROM mytable WHERE DATEDIFF(day, logged, '2000-05-01') <= 0 and
DATEDIFF(day, logged, '2000-05-30') >= 0

Any better ways to do this ?


Thanks
Alex

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

Reply via email to