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!

Decode Funcion Help

Status
Not open for further replies.
Apr 8, 2001
8
US
Hi,

I need to write a decode on a field 'MCO'. If the zip code is between 00000 and 14999 then MCO = 413, if zipcode is between 15000 and 39999 then MCO = 414... and so on.. How do I do this?

Thanks
 
elwayisgod

Is Decode for 'MCO' in the Query or Results Section? If Query what Database? If results have you looked at Switch Case?

Regards

Wayne Van Sluys
KeyPulse, Inc.
 
Couldn't you use the substring function in a new, computed column that tests for the value of the MCO item?

if (Substr(MCO, 1, 5) <= 14999)
413;
else
if (Substr(MCO, 1, 5) >= 15000)
414;
else

and so on......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top