Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query All Odd Days in a DateTime Field
Message
De
25/01/2009 08:51:12
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01376540
Message ID:
01376831
Vues:
13
>>>>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

Interesting, I tried using DAY() and it returned an error that it couldn't be used....which is why I posted.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform