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!

How do I select data based on presence of other data?

Status
Not open for further replies.

SimonPGreen

IS-IT--Management
Mar 8, 2004
116
GB
Hi all,

Have a table containg following fields:

strPackageName String
intApplicationNumber Integer
curForecast Currency
curValue Currency
curCertified Currency

Is it possible to build a select query that lists strPackageName,intAppcationNumber and either curCertified, curValue or curForecast conditionally i.e If curCertified > 0 use it else if curValue > 0 use it else use curForecast.

Any help greatly appreciated.

Regards

Simon
 
Something like this ?
SELECT strPackageName, intApplicationNumber,
IIf(curCertified>0,curCertified,
IIf(curValue>0,curValue,curForecast)) AS myCurrency
FROM yourTable

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top