Hello friends,
I am ateempting to build a query base on automatic date range. This query will be run on the first of every month for data of the past month and a half (i.e. Between '20040816' And '20040930'...if it was run on 10/01/2004)
My two questions are this:
1) How do I construct my Between statement for the begin-date to be the 16th of two months ago and the end-date to be one day ago (I understand that Date()-1 would give me the end-date since I am running this the first of the month).
2) Relating to question one, how then would I convert that date format to a number as the data on my SQL server is of a number type yyyymmdd (i.e. 20040816 is the representation for 08/16/2004).
Thank you so very much for your help ahead of time.
I am ateempting to build a query base on automatic date range. This query will be run on the first of every month for data of the past month and a half (i.e. Between '20040816' And '20040930'...if it was run on 10/01/2004)
My two questions are this:
1) How do I construct my Between statement for the begin-date to be the 16th of two months ago and the end-date to be one day ago (I understand that Date()-1 would give me the end-date since I am running this the first of the month).
2) Relating to question one, how then would I convert that date format to a number as the data on my SQL server is of a number type yyyymmdd (i.e. 20040816 is the representation for 08/16/2004).
Thank you so very much for your help ahead of time.