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

Grouping by 15min increments

Status
Not open for further replies.

BIProf

MIS
Oct 8, 2001
9
0
0
US
How do I create a grouping in Business Objects based on 15min intervals? RDBMS is sybase.
 
Assuming <DateTime> is the variable with the date/time you want to group, you could create a variable with the following formula:

=AsDate(FormatDate(<DateTime>, &quot;yyyy-mm-dd HH:&quot;) & FormatInteger(LowerInteger(AsInteger(FormatTime(<DateTime>, &quot;mm&quot;))/15)*15, &quot;00&quot;), &quot;yyyy-mm-dd HH:mm&quot;)

I'm not sure of the names of the functions, since I use the spanish version. Note that 'AsInteger(FormatTime(<DateTime>, &quot;mm&quot;))' is a kind of 'Minutes(<DateTime>)'.

The trick is in 'LowerInteger(<minutes>/15)*15', that returns 0 to range [0-14], 15 to range [15-29], etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top