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

Grouping problem

Status
Not open for further replies.

AMS100

Programmer
Oct 19, 2001
111
GB
Using HowardHammerman's date\time subtraction formula (which I must say is a great tutorial) I am subtracting two dates. I have split up the time into 4 separate fields: -days, hours, minutes and seconds. What I need to do is group by 6 different criteria -
Less than 1 Hour,
Greater than 1 hour less than or equal to 2 hours,
Greater than 2 hours less than or equal to 5 hours,
Greater than 5 hours less than or equal to 1 Day,
Greater than 1 Day less than or equal to 3 days and finally
Greater than 3 days.
I thought that I would be able to do this using the 'Specify order' option but you cannot seem to say >1 day AND <=3 CR defaults in 'OR @day'. I could well be going about this is the wrong way, if anyone has done this before or has any ideas please let me know, any help is very much appreciated.
 
Try a formula which evaluates the time value and assigns a category between a and f (six categories). You can then group by the formula field. This will allow you to have your 6 groups and maintain the actual time values
 
Thanks very much thats done the trick. Here comes the 'but'..... The problem I'm having now is on certain dates where the value is double figures E.g 22 hours it will asume that 22 is between 2 and 3. Do I need to first convert the value from a 'STRING' to a 'NUMBER'. I'm still new to CR so I'd rather ask than waste the next hour or so trying the 'convert' function.
 
Yes, convert it by using the ToNumber() function. Syntax is Tonumber({Fieldname})

Glad I could help.

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top