Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query All Odd Days in a DateTime Field
Message
 
 
To
25/01/2009 08:51:12
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01376540
Message ID:
01376854
Views:
8
>>select case when DAY(EventTime)%2 =0 then 1 else 0 end as Even from CommunicationLog
>
>Interesting, I tried using DAY() and it returned an error that it couldn't be used....which is why I posted.

Strange, worked for me in SQL 2008

select * from CommunicationLog where DAY(EventTime)%2 =0

where did you try this type of query?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform