Suppose you’d like to select rows in an Salesforce Marketing Cloud data extension created on the last day of the month. Here’s what I use:
The last portion of the where clause finds the first day of the next month and then subtracts one day.
Normally queries like this run in a daily automation.
For further reading:
- Query Activity
- T-SQL DATEDIFF function
- T-SQL DATEADD function
- SQL-Server find the last day of any month