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

Query - calculate quarter-to-date?

Guest
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

Hello

Trying to "do the math" - getting nowhere fast.

<cfset FirstDayOfQuarter = ?>

<cfset LastDayOfQuarter = #CreateODBCDate(Now())#>

SELECT etc.

WHERE ((order_create_date BETWEEN #CreateODBCDate(FirstDayOfQuarter)# AND #CreateODBCDate(LastDayOfQuarter)#))

I'm sure there is more than one way to accomplish this, and CF has #Quarter(Now())# but that result just dispalys what quarter you happen to be in now.

Any help would be appreciated.....

Thanks- Norman

TOPICS
Advanced techniques

Views

587

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 ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

LATEST

We have a very useful table in our data warehouse called period.  The primary key is the date and other fields include fiscal year, fiscal quarter, fiscal period, holiday, and a few more.  You might want to consider something similar.

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