J
Jack
Hi,
I have say a union query as follows:
select salesman, custid, month1amt, month2amt, month3amt, .....month12amt
from query1
union all
select salesman, custid, month1amt,...................
from query2
union all
select salesman, custid, month1amt, month2amt, month3amt,
.........................
from query3
....
The problem is that in the union query there is no way of knowing that some
of the columns may not exist. So if a column does not exist is there any way
put a null in the column programmatically so that the union query will not
break due to similar number of columns in the union query. I appreciate any
help for resolutio of this issue. Thanks.
I have say a union query as follows:
select salesman, custid, month1amt, month2amt, month3amt, .....month12amt
from query1
union all
select salesman, custid, month1amt,...................
from query2
union all
select salesman, custid, month1amt, month2amt, month3amt,
.........................
from query3
....
The problem is that in the union query there is no way of knowing that some
of the columns may not exist. So if a column does not exist is there any way
put a null in the column programmatically so that the union query will not
break due to similar number of columns in the union query. I appreciate any
help for resolutio of this issue. Thanks.