Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Help SQL / REPORTS query
Hi All
I have a report to write and part of thae report is to compare the data with a same period from last year I've written the SQL but I dont know how to link the two queries together. I've included the 2 queries. (I plan to use parameters for the dates - I can do that bit!)
Can any one offer advice (oracle 7.3 and reports 2.5)
TIA Ade
SQL1
select oh.OH_REFERERS_CODE, count(oh.OH_P_CRN) 'new count'
from ORDER_HEADERS oh
where oh.OH_CLINIC_DATE>='01/01/1998' AND oh.OH_CLINIC_DATE<='01/01/1999'
Group by oh.OH_REFERERS_CODE
Order by oh.OH_REFERERS_CODE
SQL2
select oh.OH_REFERERS_CODE, count(oh.OH_P_CRN) 'OLD count'
from ORDER_HEADERS oh
where oh.OH_CLINIC_DATE>='01/01/1997' AND oh.OH_CLINIC_DATE<='01/01/1998'
Group by oh.OH_REFERERS_CODE
Order by oh.OH_REFERERS_CODE
Received on Thu Feb 18 1999 - 10:52:06 CST
![]() |
![]() |