Copy link to clipboard
Copied
I have a query that I am working with in which I have a month and year field where I would like to display the current month and previous months information just not quite sure how to make this work.
My table rows look like this
I have looked over all of Coldfusions Date Functions and several articles that are similar but not sure how to tie this all together.
These variables should get you started.
year1 = year(now());
month1 = month(now());
year2 = year(DateAdd("m", -1, now()));
month2 = month(DateAdd("m", -1, now()));
You can figure out how to use them in your query.
Copy link to clipboard
Copied
Are you wanting to query the data for the current month and previous month using the nmonth a nyear fields?
Copy link to clipboard
Copied
These variables should get you started.
year1 = year(now());
month1 = month(now());
year2 = year(DateAdd("m", -1, now()));
month2 = month(DateAdd("m", -1, now()));
You can figure out how to use them in your query.
Copy link to clipboard
Copied
Thank You for your help on this