Results 1 to 10 of 10

Thread: Grabbing quarter from month?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44

    Grabbing quarter from month?

    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!
    Last edited by Magoo5289; Oct 12th, 2004 at 02:11 PM.

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    You can go into the section expert. In there, you will find a 'page break before' and a 'page break after' check box.

  3. #3
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    Instaed of listing the current month, why not create a formula that equals datepart("m",currentdate) - 1

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44
    The formula works well, however is there a way to get it to display August instead of 8?

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44
    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.

  6. #6
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    You may just have to set a case statement on the month value. Only 12 values, so it won't be too big.

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44
    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?

  8. #8

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44
    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.

  9. #9

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44
    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?

  10. #10

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44
    Got it fixed... now if you wouldn't mind looking at my page break question....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width