Skip navigation
Currently Being Moderated

Query - calculate quarter-to-date?

Jul 25, 2012 9:32 AM

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

 
Replies
  • Currently Being Moderated
    Jul 25, 2012 11:02 AM   in reply to sakonnetweb

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points