Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple rolling Quarterly formula

Status
Not open for further replies.

muffntuf

MIS
Jan 7, 2003
155
US
Hi,

My brain is dead today, I need to do a simple quarterly formula you know:

If datefield in January - March then "Quarter 1" etc.

Except I need to be able to make this a rolling quarterly deal so if the report was run today or a year from now the formula would never have to be maintained manually. I know it is using currendate, cut I don't have my cheat sheet stuff with me today.

CR10 is fine.
Thanks,
muffntuf
 
So you want just the current quarter, or the last full quarter, or the last year of quarters, or?

-k
 
I want to group by quarters, but I want it set up by taking currentdate - or + whatever to make the quarters up.

Boy I really am drawing a blank today! I have done this, but don't remember it right now.
 
muffntuff

your question isn't making any sense. How does the quarter relate to todays date ?

try giving a sample of your data and the expected outcome.

Gary Parker
MIS Data Analyst
Manchester, England
 
Are you looking for DatePart("q", currentdate)? That would be 1, 2, 3 or 4, depending on the current date.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Does that need the "q" to be identified then? Or does "q" use the standard Jan- 1 to March 31, etc. for quarters?
 
You should be able to adjust it. The format can be DatePart (intervalType, inputDateTime, firstDayOfWeek, firstWeekOfYear), so it should be possible to adjust it.

Or say "m" for month number, 1 to 12, and then group them your own way.
Code:
if @month in [4, 5, 6] then "Q1"
etc.

Try using Crystal Help; lots of useful info there.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top