Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 dates

Author  Topic 

thecarcrashhh
Starting Member

1 Post

Posted - 2008-12-09 : 13:52:41
I am working on a query to find:

a list of all course sections scheduled to start in the future (from tomorrow on).

I have course sections and dates which they start but i am not sure as to how i select only those starting from "tomorrow" onward.

Any ideas are appreciated.

hanbingl
Aged Yak Warrior

652 Posts

Posted - 2008-12-09 : 13:59:21
[code]where startdate > getdate()[/code]
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2008-12-09 : 17:27:22
SELECT *
FROM MyTable
WHERE MyDate >= DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP), 1)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-10 : 02:21:48
quote:
Originally posted by hanbingl

where startdate > getdate()



will take timepart also in comparison which will cause ones with todays date but at earlier time to be excluded
Go to Top of Page
   

- Advertisement -