Skip to Content

Date grouping formula Crystal

Hi,

Our production cycle time is from 06:00 AM till 06:00 AM. When in a report i want to see the production figures group by date, it is doing the normal grouping that is 00:00 till 23:59 and then it changes the date. There is an option to put my own formula to group date.

For example, the below result should be in a single line. This is production of 02-June. (The cycle 06:00 AM 02 June till 06:00 AM 3 June is considered as production of 2 June only).

Can anyone please help me what would be the formula for starting the day at 06:00 AM and ending at 05:59 AM. (So the date change would be at 06:00 AM) not at 12 midnight.

capture.jpg (31.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jul 12, 2020 at 10:07 PM

    Hi Saad,

    1. Create a formula with this code:

    local timevar st := time(06,00,00);
    local timevar ed := time(05,59,59);
    local datetimevar fdt := If time({DateField}) < st then Datetime(date(DateAdd("d", -1, {DateField})), st) else Datetime(date({DateField}), st);
    fdt;

    2. Insert a Group on this formula field > Group options > set the group to print "For Each day"

    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 12, 2020 at 01:36 PM

    Abhilash Kumar Can you please help also with this one

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.