Home » Developer & Programmer » Reports & Discoverer » How can used UNION STATMENT ACCORDING CONDITION in REPORT?
How can used UNION STATMENT ACCORDING CONDITION in REPORT? [message #304414] Wed, 05 March 2008 01:48 Go to next message
j1968s
Messages: 7
Registered: January 2008
Junior Member
HI ALL

How can used UNION STATMENT ACCORDING CONDITION in REPORT?

I mean that I have two Table , If the date > year(2000) will use one table but if the date < year (2000) will use tow table
IN FORM THAT's NOT problme BUT in report how it's will do it ?


 CASE WHEN DATE  > '01-JAN-2000' then
	SELECT ALL FROM INVOICE WHERE INVOICE_DATE >= DATE
ELSE
	SELECT ALL FROM INVOICE WHERE INVOICE_DATE >= DATE
        UNION ALL
	SELECT ALL FROM ARCHIVE_INVOICE WHERE INVOICE_DATE >= DATE
END


ARE IT'S AVAILABLE ??
THANKS FOR ALL
Re: How can used UNION STATMENT ACCORDING CONDITION in REPORT? [message #304422 is a reply to message #304414] Wed, 05 March 2008 02:43 Go to previous messageGo to next message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Your table should have a same structures...
Re: How can used UNION STATMENT ACCORDING CONDITION in REPORT? [message #304441 is a reply to message #304422] Wed, 05 March 2008 03:59 Go to previous messageGo to next message
j1968s
Messages: 7
Registered: January 2008
Junior Member
YES THE TWO TABLE HAVE SAME STRUCURE

ARE It's available ?????
Re: How can used UNION STATMENT ACCORDING CONDITION in REPORT? [message #304443 is a reply to message #304441] Wed, 05 March 2008 04:02 Go to previous message
Littlefoot
Messages: 21812
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a VIEW (as union of two tables you have) and use the view only.
Previous Topic: Carry forward TOTALS(Cumulative Total)
Next Topic: A printing report without colors !!!!!!!!!!
Goto Forum:
  


Current Time: Mon Jul 01 02:27:08 CDT 2024