IsNull/Coalesce problem

morganw

New Member
Good morning,
I have 2 queries (see below) and would like either one to work.
Basically, I need 1 field, and if this has no data in it, I need the second field instead. Can someone help please?

select * from openquery(sosprogress, 'SELECT cl-code, a-name, a-full-address, IsNull(Contact1, Contact2) FROM clidb')

select * from openquery(sosprogress, 'SELECT cl-code, a-name, a-full-address, Coalesce(Contact1, Contact2) FROM clidb')

Thanks,
Wayne.
 
CASE var:
WHEN 'whatever' THEN
DO:
/* procedure block here */
/* select * from openquery(sosprogress, 'SELECT cl-code, a-name, a-full-address, IsNull(Contact1, Contact2) FROM clidb')*/
END.

WHEN 'whatever' THEN
DO:
/* procedure block here */
/* select * from openquery(sosprogress, 'SELECT cl-code, a-name, a-full-address, Coalesce(Contact1, Contact2) FROM clidb')*/

END.
END CASE.
 
Bearing in mind, the example provided is a SQL Server statement.....
Which is also included in a DTS Package.
 
Back
Top