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

Quarter Hour Grouping on DateTime Field

Status
Not open for further replies.

mrichey

MIS
Nov 22, 2002
71
US
I need to adapt the formula shown below (provided by sysvampire) to break the time into 15 minute (quarter-hour) intervals. I know it should be easy given the formula provided, but what can I say? Thanks!


Here's a formula for 1/2 hours for existing data:

datetime(year({Table.DateTimeField}),
month({Table.DateTimeField}),
day({Table.DateTimeField}),
hour({Table.DateTimeField}),
(
if minute({Table.DateTimeField}) < 30 then
0
else
30
)
,0)

-k
 
This depends upon how you treat time between the intervals, but using the same logic as before, you could use:

datetime(year({Table.DateTimeField}),
month({Table.DateTimeField}),
day({Table.DateTimeField}),
hour({Table.DateTimeField}),
(
if minute({Table.DateTimeField}) < 15 then
0 else
if minute({Table.DateTimeField}) in 15 to 29 then
15 else
if minute({Table.DateTimeField}) in 30 to 44 then
30 else
45
)
,0)

-LB
 
Try:

datetime(year({Table.DateTimeField}),
month({Table.DateTimeField}),
day({Table.DateTimeField}),
hour({Table.DateTimeField}),
(
if minute({Table.DateTimeField}) < 16 then
15
else
if minute({Table.DateTimeField}) < 31 then
30
else
if minute({Table.DateTimeField}) < 46 then
45
else
0
)
,0)

sysvampire?

-k
 
Thanks guys! That did it.

Sysvampire. LOL!!!

Sorry 'bout that. You're much too good to have your name mangled like that.
 
Hmmm, I think that the name is already sorta self-mangled.

sysvampire sounds like some eeeeeee-vuhl whacked out hacker ;)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top