I need to return all records created in a specific YYYY-MM
I've optimized the query by filtering out the IDs prior to joining all my other tables, but I'm curious if there's a better date compare.
Here's the pertinant code bit:
TIA,
Lodlaiden
A lack of experience doesn't prevent you from doing a good job.
I've optimized the query by filtering out the IDs prior to joining all my other tables, but I'm curious if there's a better date compare.
Here's the pertinant code bit:
Code:
FROM(
SELECT LCi.ID FROM dbo.myTable LCi (NOLOCK)
WHERE datepart(year,(LCi.myDate)) = (datepart(year, @myDate))
AND datepart(month,(LCi.myDate)) = (datepart(month, @myDate))
) as LC
TIA,
Lodlaiden
A lack of experience doesn't prevent you from doing a good job.