Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a better way of selecting information for a dat
Message
From
26/04/2007 09:33:32
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01219598
Message ID:
01220101
Views:
22
>>>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/
Previous
Reply
Map
View

Click here to load this message in the networking platform