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

Conditional Returns in SQL 1

Status
Not open for further replies.

hegartyjp

Programmer
Jun 16, 2004
57
US
Hi,

Would really appreciate some help with this query. I am moving an access database on to SQL Server and need to reproduce some reports.

The reports are mostly based on Bands that are created during running the query behind the report.


So if the field being reported was value and the bands are 1-29, 30 - 60, and >60,

The query uses a simple IIF statement in Access but I can not figure out how to do this in a stored procedure.

i.e

BAND: Iif (value < 30, "BAND A", Iif( value < 61, "BAND B", BANDC)))

Is this sort of thing possible in a stored procedure or do I need to make a table and update it or something?

Any advice greatly appreciated.

Thanks

JP


 
Oh cheers mate. As easy as that.

Really do appreciate it.

Exactly what I need.

Thanks

JP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top