Skip to main content

All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
7k views

How to find XXth day of previous month in SQL server?

I have 2 parameters, an input date (DATETIME) input day of month (TINYINT) If I enter 11 MAR 2014 as the DATETIME and 26 as the input day of month, I would like to select 26 FEB 2014 as the output ...
JohnLinux's user avatar
  • 255
3 votes
2 answers
40k views

Should I join datetime to a date using cast or range?

This question is a take-off from the excellent one posed here: Cast to date is sargable but is it a good idea? In my case, I am not concerned with the WHERE clause but in joining to an events table ...
Matthew's user avatar
  • 1,693