[RESOLVED] Query using Dates [mssql 2000]
Hi guys good day.
How would I eliminate the time in a datetime field.
i.e the value in the table in a datetime field is
2/9/2006 1:13:49 PM and I want to select data that has date 2/9/2006.
'assuming the xdate has (2/9/2006 1:13:49 PM) value
select * from table where xdate='2/9/2006' <---it wont work because xdate value has time and the time are included in the where clause. What I want is to select the specific date excluding the time.
thanks in advance.
Re: Query using Dates [mssql 2000]
Using the Convert function is one option
Where Convert(varchar(10), xdate ,101) = '02/09/2006'
Style 101 = mm/dd/yyyy
Re: Query using Dates [mssql 2000]
Quote:
Originally Posted by brucevde
Using the Convert function is one option
Where Convert(varchar(10), xdate ,101) = '02/09/2006'
Style 101 = mm/dd/yyyy
thanks mate! It works. :)