Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding function to SQL Server
Message
From
24/02/1999 08:52:56
 
 
To
24/02/1999 08:02:39
Christian Bellavance
Université du Québec à Hull
Hull, Quebec, Canada
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00189928
Message ID:
00190902
Views:
13
I haven't seen a easy solution to the problem you running into to. I use DATEPART() to seperate the datetime into two components: year and days-in-year

SELECT * FROM table
WHERE DATEPART(yy, datetimecolumn) = DATEPART(yy, sarg)
AND DATEPATH(dy, datetimecolumn) = DATEPART(dy, sarg)

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform