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!

Need Help Selecting Values, Based on a Single Field in same Table 1

Status
Not open for further replies.

Kenos

Programmer
Jul 21, 2002
28
0
0
US
I have one table that holds Billing and Shipping information
There is a Bit set to true if the Billing is the same as the Shipping

Here is what I need to do

If Bit = true Show shipping info
If Bit = False Show billing info

Fields are
BillingFirstname ,BillingLastName, ShippingfirstName, ShippingLastName

If anyone could help that would be great
 
Code:
select case when bitColumn = 1 then ShippingfirstName 
            else BillingFirstname end,
       case when bitColumn = 1 then ShippingLastName 
            else BillingLastname end
   from t
 
Thanks you very much swampBoogie,
Now I can enjoy the weekend

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top