Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a better way of selecting information for a dat
Message
De
26/04/2007 09:33:32
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01219598
Message ID:
01220101
Vues:
18
>>>Consider the following select statement:
>>>
>>>SELECT	[Id]
>>>FROM	[MyTable]
>>>WHERE	YEAR(DateField) = YEAR(@DateField) AND
>>>	MONTH(DateField) = MONTH(@DateField) AND
>>>	DAY(DateField) = DAY(@DateField)
>>>
>>>
>>>I want to select the records that have the same date as the parameter, but I do not care about the time part of the field or parameter.
>>>Is there another (better) way of doing this?
>>>
>>>Thanks,
>>>Einar
>>
>>I have an example that does it a bit differently, but I am in Milwaukee this week. I might be able to get that to you on Friday.
>
>I could drive down to Milwaukee and get it :) Yeah please post when you get back.

LOL, I don't have it here! Isn't it funny where you remember exactly where you used a piece of code and what you used it for, but can't remember what it was?
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform