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

Min/Max from converted 6 digit decimal with no date

Status
Not open for further replies.

TylerDrew

IS-IT--Management
Apr 4, 2011
1
US
Hi,

I've converted a 6 digit decimal field (130200.00 would be 1:02:00AM)to a time field, then created 2 other formulas that pull the minimum and maximum time from the list of count start times. My problem is that since there is no date field (the time spans overnight as this is for a warehouse counting report) the min and max come out incorrect. For instance, for the min formula, it always takes the lowest AM field as the min, even though it should take the lowest PM time, because the counts start around 6pm and finish around 2AM. Is there a way to write a formula that can figure this out without dates?

Thanks,
Tyler
 
Why not find the min and max on the unconverted field, and then convert its value?

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
You could adjust the field back two hours, so that all instances occur on the same date. This would allow you to identify the min and max. You could then display the actual field in the report, identified as min or max.

dateadd("h",-2,datetime(currentdate,{table.starttime}))

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top