SQL Server 2005 - SQL Help (Date Query)

Associate
Joined
2 Sep 2007
Posts
2,001
Hi All

I want to only show dates which greater than today's date more than 10 days. What would I put in the filter in the following screenshot. When I type in >=01/01/2008 it automatically puts in >= TO_DATE('01/01/2008', 'MM/DD/YYYY')

Would I do something like:-

>= TO_DATE(NOW()+10, 'MM/DD/YYYY')

When I type in the above it says 'Your entry cannot be converted to a valid date time value' Any ideas what I need to put?


databasehelpgf0.jpg
 
Last edited:
try :

Code:
select slot_id, start_time, slot_Active
from fes.YM_BKSB_SLOTS
where (SLOT_ACTIVE = 'Y') [b]AND datediff(dd,getdate(),start_time) > 10[/b]

[edit]you might have to try swapping "getdate()" and "start_time" as I can't remember which way round the parameters go.[/edit]

akakjs
 
try :

Code:
select slot_id, start_time, slot_Active
from fes.YM_BKSB_SLOTS
where (SLOT_ACTIVE = 'Y') [b]AND datediff(dd,getdate(),start_time) > 10[/b]

[edit]you might have to try swapping "getdate()" and "start_time" as I can't remember which way round the parameters go.[/edit]

akakjs

Cheers will try it tomorrow just got home from work. So getDate() is the similar to Now() in access?
 
Back
Top Bottom