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!

Nested CASE in formula?

Status
Not open for further replies.

celauritz

Technical User
Dec 2, 2005
41
US
Is something like this possible? Basically, every formula either returns a 1 or a 0, but it only reads down to "Cable/Internet" and then everything else comes as a blank value.

SELECT {@CABLE}
CASE 1 :
SELECT {@INTERNET}
CASE 1 :
SELECT {@PHONE}
CASE 1: "THREE PLAY"
CASE 0: "CABLE/INTERNET"
CASE 0 :
SELECT {@PHONE}
CASE 1 : "CABLE/PHONE"
CASE 0 : "CABLE ONLY"
CASE 0 :
SELECT {@INTERNET}
CASE 1 :
SELECT {@PHONE}
CASE 1 : "INTERNET/PHONE"
CASE 0 : "INTERNET ONLY"
CASE 0 :
SELECT {@PHONE}
CASE 1: "PHONE ONLY"
CASE 0: "NADA
 
Add parens as follows:

SELECT {@CABLE}
CASE 1 :
(
SELECT {@INTERNET}
CASE 1 :
SELECT {@PHONE}
CASE 1: "THREE PLAY"
CASE 0: "CABLE/INTERNET"
CASE 0 :
SELECT {@PHONE}
CASE 1 : "CABLE/PHONE"
CASE 0 : "CABLE ONLY"
)
CASE 0 :
(
SELECT {@INTERNET}
CASE 1 :
SELECT {@PHONE}
CASE 1 : "INTERNET/PHONE"
CASE 0 : "INTERNET ONLY"
CASE 0 :
SELECT {@PHONE}
CASE 1: "PHONE ONLY"
CASE 0: "NADA"
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top