SELECT TABLEA.CODE, TABLEA.DATE, TABLEA.FIELD
FROM TABLEA
where TABLEA.CODE = 'XX'
UNION all
SELECT TABLEB.CODE, TABLEB.XXDATE AS DATE, TABLEB.FIELD
FROM TABLEB
where TABLEB.CODE <> 'ZZ'
UNION all
SELECT TABLEC.CODE, TABLEC.DATE, TABLEC.FIELD
FROM TABLEC
where TABLEC.FIELD= "YY"
TABLEB has 2 differents date fields:
XXDATE - most important but may be null,
ZZDATE - always significant.
Someone will be able to say me how to set - for TABLEB - field DATE with XXDATE or, if null, with ZZDATE?
TABLEA has only one date, I can't insert another date field ...
Thanks in advance
FROM TABLEA
where TABLEA.CODE = 'XX'
UNION all
SELECT TABLEB.CODE, TABLEB.XXDATE AS DATE, TABLEB.FIELD
FROM TABLEB
where TABLEB.CODE <> 'ZZ'
UNION all
SELECT TABLEC.CODE, TABLEC.DATE, TABLEC.FIELD
FROM TABLEC
where TABLEC.FIELD= "YY"
TABLEB has 2 differents date fields:
XXDATE - most important but may be null,
ZZDATE - always significant.
Someone will be able to say me how to set - for TABLEB - field DATE with XXDATE or, if null, with ZZDATE?
TABLEA has only one date, I can't insert another date field ...
Thanks in advance