Alex
Roll on SQL 2000 with user defined functions
The DatePart function will the first written
re
> Say I want records from 1/05/2000 to 30/05/2000 and my logged column is of
> datetime type.
>
SELECT * FROM mytable WHERE logged >= '2000-05-01' AND logged <
'2000-06-01'
will work
(prob a bad example)
Regards Neven
N.K. MacEwan B.E. E&E
[EMAIL PROTECTED]
----- Original Message -----
From: Alex Kouznetsov <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Thursday, 1 June 2000 16:23
Subject: [DUG]: Date portion of MSSQL datetime data type
> 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
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz