Adding Numbers To Date/Time Values
Posted August 4, 2006 at 2:25 PM by Ben Nadel
Ok ok, last SQL date/time post I swear. But, while testing my last entry idea, I realized you can add numbers to your date/time values. Wicked cool:
- SELECT
- -- Query for yesterday's date.
- (
- getDate() - 1
- ) AS yesterday,
-
- -- Query for tomorrow's date.
- (
- getDate() + 1
- ) AS tomorrow
Just note that this leaves in the TIME value as-is.
Reader Comments
There are no comments posted for this web log entry.



