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

Negative Time formats 2

Status
Not open for further replies.

jlg5454

Technical User
Jan 6, 2005
98
US
Hello:

Does anyone know how to display -120 seconds to -hh:nn:ss format? I used NStart: Format([SUMOFSTART]/3600/24,"h:nn:ss") and this only reports a positive time value (00:02:00). How do I get the - sign in front? Any tricks that anyone knows?

Thanks,

Joe
 
How about:

Format([SUMOFSTART]/3600/24,"-h:nn:ss")
 
Thanks,

I tried that but it returns all values with a negative. I looking for a return of a negative or pos based on the field I'm formatting. (There's a mixture of neg and pos time values)

Joe
 


How about
Code:
NStart: iif([SUMOFSTART]<0,Format(Abs([SUMOFSTART])/3600/24,"-h:nn:ss"),Format([SUMOFSTART]/3600/24,"h:nn:ss"))

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Perfect! I can't believe I did not think of that.

Joe
 
I'd use this:
NStart: Format([SUMOFSTART])/3600/24,IIf([SUMOFSTART]<0,"-","") & "h:nn:ss")
 
PHV,

That worked too. It just needed another ( after format.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top