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

Changing numbers in a query

Status
Not open for further replies.

Board2Death

Technical User
Apr 27, 2005
88
US
I have a field named Within in a query that contains integer values.

I would like to create another field Tally in the query where:

if Within is less than or equal to 0, Tally = -1 [/color blue]

Otherwise Tally = 0 [/color blue]

I am stumped. Any ideas would be greatly appreciated. TIA...
 
In the query grid:
Tally: IIf([Within]<=0, -1, 0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Without seeing your query this is a little difficult, however you could try something like:

SELECT Within, IIf(Within <=0,-1,0) AS Tally FROM YourTable

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top