×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Grouping by 24 hour time periods from 8:00:00 - 7:59:59

 Forum Search FAQs Links MVPs

## Grouping by 24 hour time periods from 8:00:00 - 7:59:59

(OP)
I am trying to group data by 24 hour time periods. For instance the first time period is from 1/1/2014 8:00:00 to 1/2/2014 7:59:59, the second 1/2/2014 8:00:00 to 1/3/2014 7:59:59, the third 1/3/2014 8:00:00 to 1/4/2014 7:59:59, etc.

I could set up groups by a specified order, but that would require specific date ranges and a lot of work.

The report should run by parameters in 24 hour increments starting at 8:00 am on a particular day through another date.

Any ideas?

I appreciate any help.

### RE: Grouping by 24 hour time periods from 8:00:00 - 7:59:59

IF HOUR({TIME FIELD}) < 8
THEN TOTEXT(({DATE FIELD}-1),"yyyyMMdd")
ELSE TOTEXT({DATE FIELD},"yyyyMMdd")

Use that formula to group by.

### RE: Grouping by 24 hour time periods from 8:00:00 - 7:59:59

(OP)
I am receiving an error: The results of selection formula must be a Boolean.

### RE: Grouping by 24 hour time periods from 8:00:00 - 7:59:59

This does not go in your select formula.

The formula above it what you would use for grouping.

If you want to select by 24 hour periods, then the formula gets changed slightly:
@day24
IF HOUR({TIME FIELD}) < 8
THEN {DATE FIELD}-1)
ELSE {DATE FIELD}

Then you can put in your select formula:

{@day24} in {?Date Range}

### RE: Grouping by 24 hour time periods from 8:00:00 - 7:59:59

(OP)
I think I am having problems because my data field is a date/time field. I do not have separate fields for date and time. Do I need to adjust the formula because of this?

### RE: Grouping by 24 hour time periods from 8:00:00 - 7:59:59

@day24
IF HOUR({DATETIME FIELD}) < 8
THEN DATE({DATETIME FIELD})-1
ELSE DATE({DATETIME FIELD})

### RE: Grouping by 24 hour time periods from 8:00:00 - 7:59:59

(OP)
Thank you so much - It works!

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

#### Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!