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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expanding Time Range for a day 1

Status
Not open for further replies.

c0wt0wn1

Programmer
Feb 24, 2004
33
US
Hi.

I am running CR 8.5.

I am calculating all the transactions for 1 day and I am running into a problem. The day currently only returns everyting from 12AM to 11:59PM. This is fine for normal businesses but I work at Disneyland and we have abnormal hours.

Here is what I would like.

Group1 Location
Group2 Day (Days start at 0400hrs and go until 0300hrs the next day)

So the report would look something like this.

Costuming
Sunday 04-04-04 //(04/04/04 04:00:00 - 04/05/04 03:00:00)
Details
Monday 04-05-04 //(04/05/04 04:00:00 - 04/06/04 03:00:00)
Details


Currently I am getting back the information like this

Costuming
Sunday 04-04-04 //(04/04/04 00:00:00 - 04/04/04 23:59:59)
Details
Monday 04-05-04 //(04/05/04 00:00:00 - 04/05/04 23:59:59)
Details

Normally this is fine but the transacitons Early Sunday morning will through off my count. I am using the following formula in the select expert to get all the transactions for the week that I need:

TimeVar T1 := TimeSerial (04,00,00);
TimeVar T2 := TimeSerial (03,00,00);

{gusd_unique_garment_log.tran_datetime} in DateTime ({?BeginningDate},T1 ) to DateTime({?EndDate} +1,T2 )

The problem with this is the grouping mentioned above.
Please let me know what I can do...

Thanks

-c0wt0wn1-
:)MikeGose
 
Create a formula {@myday}:

if {table.datetime} in datetime(date({table.datetime}),time (04,00,00)) to
datetime(date({table.datetime})+1,time(03,00,00)) then {table.datetime} else {table.datetime}-1

Then group on this formula.

-LB
 
Thanks,

Tha worked out beautifully!

:)



-c0wt0wn1-
:)MikeGose
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top