I have a SQL script that works in a custom folder using the UNION ALL insruction. What I want is to be able to reproduce it with complex folders. Since conditions and new elements apply to the whole folder, I was able to make 2 separate complex folders for each «part» of the UNION statement. I'm looking for a way to «unionize» those folders.
Here is an example of the script :
(The whole works great in a custom folder)
SELECT (this part in complex folder 1)
'On hands' grp_description,
Fiscal_year,
Close_code,
FROM
a Time,
b Status
c Products
WHERE
a.key = c.Time_key AND
b.key = c.Stat_key AND
TO CHAR(c.Effective_date, 'DD/MM') = '01/01'
UNION ALL
SELECT (this part in complex folder 2)
'Shipped' grp_description,
Fiscal_year,
Close_code,
FROM
a Time,
b Status
c Products
WHERE
a.key = c.Time_key AND
b.key = c.Stat_key AND
TO CHAR(c.Effective_date, 'DD/MM') = '31/12'
Any idea ??
Thanks
Here is an example of the script :
(The whole works great in a custom folder)
SELECT (this part in complex folder 1)
'On hands' grp_description,
Fiscal_year,
Close_code,
FROM
a Time,
b Status
c Products
WHERE
a.key = c.Time_key AND
b.key = c.Stat_key AND
TO CHAR(c.Effective_date, 'DD/MM') = '01/01'
UNION ALL
SELECT (this part in complex folder 2)
'Shipped' grp_description,
Fiscal_year,
Close_code,
FROM
a Time,
b Status
c Products
WHERE
a.key = c.Time_key AND
b.key = c.Stat_key AND
TO CHAR(c.Effective_date, 'DD/MM') = '31/12'
Any idea ??
Thanks