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

Create a negative value 1

Status
Not open for further replies.

mapman04

IS-IT--Management
Mar 28, 2002
158
US
I'm trying to create a new field in a query using the IIF keyword. The table holds a - or + sign to designate whether the transaction quantity is negative or positive. In the query string I have the following:

IIF(table1.signvalue = '-',-1,1)

When I generate the query, if it has the + sign, I get the 1. But if it has the - sign, it returns the *. What's the trick to get it to return a -1?

Thanks,

mapman04
 
Hi,

Just add a zero so that both results have two bytes.

IIF(table1.signvalue = '-',-1,01)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top