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

Inline IF statement

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,

I have a query that is to sum up a time from a second query.

the query uses the variable 'total' as the column to sum.

I need help with a iif statement to check for negative times, if they are negative then I need to mulitple it by -1 to get a positive result.

Any help would be welcomed

Gary
 
=IIF(yourfield < 0, yourfield * -1, yourfield)

so it works like this

if your field is less than zero then
take yourfield times negeative 1
else just yourfield left alone

the True part is left after the first comma
and the False part is after the second comma

;-) DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top