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

Create Group from DateTime field?

Status
Not open for further replies.

Oglesbay

Instructor
May 5, 2006
71
US
Hello all. I have a report that returns evaluations from every class that we teach. We normally teach all-day classes so when we run the report it is easy to take out the daily evaluations.

Well, we just started teaching a few half-day courses and I can't figure out how to get the group in our report to work with that. We have a DateTime field that acts as our timestamp of when the evaluation is completed online.

I want to try to create a group that says if the timestamp is between 11:00am and 12:30pm then it is goes in the Morning Class group, where if it is any other time, it goes in the Afternoon Class group.

I tried creating a Specified Order in the Group Expert with the time stamp, but when I chose the Between feature it would not let me just put 11:00am and 12:30pm, saying that the "A date-time is required here." My guess is that it wants a date as well...

Can anyone help me with this? We really need to figure out how to break it into morning and afternoon groups. Thanks in advance for any assistanc!
 
if {table.timestamp} <= time(12,30,0) then "Morning" else "Afternoon"

Make this your outer group.

-LB
 
Thanks for the quick response. I tried what you created and it is still saying "A date-time is required here" where you have "time(12,30,0)". And what do you mean by "make this your outer group?
 
Just a guess
may be it is missing one zero

if {table.timestamp} <= time(12,30,00) then "Morning" else "Afternoon"


I guess group on this formula first and then use the groups.
 
Yeah, I caught the missing zero earlier, and it still didn't work.
 
what is the formula you are using to get the time from the datetime field.

Extract the time frok thatfiled
time(table.datefield) then try this fromula.
 
That could be the issue, I'm not currently extracting the time from the DateTime field. I want to, but don't know how. I found something on Split, but would that work? Spliting the date and the time?
 
use the time() function.it will extract the time from the datetime field
 
I tried the time() function and then ran the above formula from lbass and it worked. Thanks you two!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top