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

if statement 2

Status
Not open for further replies.

Mr2006

Technical User
Jun 21, 2006
80
US
Hello

I have a calculation formula in a field, [workdays]-[offdays]-1. the result sometime shows negative number. I want to include in the formula if the total is negative, the result will be zero.

Any Suggestions!!
 
There are times when you need to convert an expression back to numeric. This may be one of them. Taking Leslie's solution you may need to use
Code:
Val(iif([workdays]-[offdays]-1<0, 0, [workdays]-[offdays]-1))

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top