• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Display query for current and previous month

Guest
May 25, 2009 May 25, 2009

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

  • nMonth
  • nYear
  • nDetail
  • nImg
  • nLink

I have looked over all of Coldfusions Date Functions and several articles that are similar but not sure how to tie this all together.

TOPICS
Advanced techniques

Views

927

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 25, 2009 May 25, 2009

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.

Votes

Translate

Translate
Guest
May 25, 2009 May 25, 2009

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 25, 2009 May 25, 2009

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 26, 2009 May 26, 2009

Copy link to clipboard

Copied

LATEST

Thank You for your help on this

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation