patsyaardvark
New Member
I am having sql result with two conditions..i need to print this two conditions in a same column in asp..sql query\[code\]select P.[Port Name], CR.Name as country,CASEwhen SIH.[Ship-to Code] = '' then (select C.Name from [Customer] C where C.No_ = SIH.[Sell-to Customer No_])end as name,case when SIH.[Ship-to Code] = '' then (select C.Address from [Customer] C where C.No_ = SIH.[Sell-to Customer No_])end as addr, casewhen SIH.[Ship-to Code] = '' then (select C.[City] from [Customer] C where C.No_ = SIH.[Sell-to Customer No_])end as cityfrom [Sales Invoice Header] SIH, [Port] P, [Country_Region] CR where No_ = 'PEXP1213-523' and P.Code = SIH.Portand CR.Code = SIH.[Country of Final Destination]union allselect P.[Port Name], CR.Name as country,casewhen SIH.[Ship-to Code] <> '' then (select C.Name from [Ship-to Address] C where C.Code = SIH.[Ship-to Code] and C.[Customer No_] = SIH.[Sell-to Customer No_])end as name,casewhen SIH.[Ship-to Code] <> '' then (select C.[Address] from [Ship-to Address] C where C.Code = SIH.[Ship-to Code] and C.[Customer No_] = SIH.[Sell-to Customer No_])end as addr,casewhen SIH.[Ship-to Code] <> '' then (select C.[City] from [Ship-to Address] C where C.Code = SIH.[Ship-to Code] and C.[Customer No_] = SIH.[Sell-to Customer No_])end as city from [Sales Invoice Header] SIH, [Port] P, [Country_Region] CR where No_ = 'PEXP1213-524' and P.Code = SIH.Port and CR.Code = SIH.[Country of Final Destination]\[/code\]