Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select
Message
From
21/09/2000 10:05:44
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Re: Select
Miscellaneous
Thread ID:
00418488
Message ID:
00419014
Views:
24
>>>I have a character field in which we store dates (format is 01/01/2000) of a persons visit. I would like to select only those that are no further back then todays date. I am using the getdate() function to determine the day. However I cannot get the results to come back correctly.
>>>
>>>
>>>what i am looking for
>>>
>>>select * from mytable where ddate >( getdate() - 6 months)
>>
>>You might want to try...
>>
>>select * from mytable where covert(datetime, ddate) > (getdate()-180)
>>
>>BOb
>
>Another way to do it is use the DATEDIFF() function.
>
>select * from mytable where datediff(m,ddate, getdate()) <= 6

Except that he said his date field was char(), or will this do an implict conversion?
Previous
Reply
Map
View

Click here to load this message in the networking platform