Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a better way of selecting information for a date?
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Is there a better way of selecting information for a date?
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01219598
Message ID:
01219598
Views:
78
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
Semper ubi sub ubi.
Next
Reply
Map
View

Click here to load this message in the networking platform