Folks/Gurus,
I would like to develop a custom month-to-date SQL with the following logic:
1- If its regular day of the month, I need a month-to-date (1st of the month to yesterday's) data, eg if its july 26th, data should be from july 1-july 25th.
2- if its 1st of the month, I need last month's month-to-date data. if its july 1, data should be from june 1-june 30th.
If this possible in one statement?
Thanks for your time and help in advance,
Sam
I would like to develop a custom month-to-date SQL with the following logic:
1- If its regular day of the month, I need a month-to-date (1st of the month to yesterday's) data, eg if its july 26th, data should be from july 1-july 25th.
2- if its 1st of the month, I need last month's month-to-date data. if its july 1, data should be from june 1-june 30th.
If this possible in one statement?
Thanks for your time and help in advance,
Sam