Click to See Complete Forum and Search --> : Grabbing quarter from month?
Magoo5289
Sep 15th, 2004, 04:21 PM
I have report with several groups/sections within it. My question is this..... is there a formula you can use that says if the current group runs over onto the next page, it will automatically create a page break so that the section begins on a new page? This would give the report a much cleaner look and feel. I could set this up for all sections, but not for just this occurrence.
While I'm at it, I do have one more question, I do monthly reporting and while I can place the current month in a field, I am not reporting on the current month, is there a way to make it state the previous month's name?
Thanks for your help as always!
Pasvorto
Sep 16th, 2004, 06:59 AM
You can go into the section expert. In there, you will find a 'page break before' and a 'page break after' check box.
Pasvorto
Sep 16th, 2004, 07:00 AM
Instaed of listing the current month, why not create a formula that equals datepart("m",currentdate) - 1
Magoo5289
Sep 16th, 2004, 09:29 AM
The formula works well, however is there a way to get it to display August instead of 8?
Magoo5289
Sep 16th, 2004, 10:36 AM
As for the section expert, it will allow me to set opage breaks and all that. I kenw how to do that already. what I was lookign for was soemthing a bit more intuitive. I only want a page break to be inserted if the current group runs over onto the next page.
Pasvorto
Sep 16th, 2004, 11:49 AM
You may just have to set a case statement on the month value. Only 12 values, so it won't be too big.
Magoo5289
Oct 12th, 2004, 02:00 PM
I managed to get the code to work in this manner:
monthname(datepart("m",currentdate) - 1)
My next question is this, does Crystal recognize how to break a month down into it's respective quarter (ie March = 1st Quarter) or would that need a case statement as well?
Magoo5289
Oct 12th, 2004, 02:35 PM
I managed to get the quarter now as well, now I just need to find the logic to place the st, nd, rd, and th after the numbers respectively.
Magoo5289
Oct 12th, 2004, 02:52 PM
I've gotten this far. Where quart= (DatePart ("q",printdate))-1
I placed this in my case statement to return:
Select {@quart}[1 to 4]
Case "1":
"1st"
Case "2":
"2nd"
Case "3":
"3rd"
Case "4":
"4th";
However, it says it expects a string, variable, boolean etc... after the select statement. What am I missing?
Magoo5289
Oct 12th, 2004, 03:14 PM
Got it fixed... now if you wouldn't mind looking at my page break question....
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.