Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query All Odd Days in a DateTime Field
Message
 
 
To
23/01/2009 10:29:20
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01376540
Message ID:
01376804
Views:
8
This message has been marked as a message which has helped to the initial question of the thread.
>>>Pretty easy to do in VFP, but how to query sqlserver and pull records with a datetime column value that is an odd day...
>>>
>>
>>
>>WHERE (DATEPART(day, DatetimeColumn) % 2) = 1
>>
>
>
>Thanks! I was playing with DATEPART but hadn't gotten there yet.

Same thing with DAY() function too.

select case when DAY(EventTime)%2 =0 then 1 else 0 end as Even from CommunicationLog
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