I want to use the start date and end date to my query in the run time. That is, I use start dateas one calendar object and end date as another. I want those values selected in the calendar object to be passed to a variable and i must use that run time variable across my dashboards.
Ex:
SELECT TOP 10 COUNT(1) PATREG,B.SRC_ID SRC_ID,B.FCLTY_NM METRIC
FROM dbo.PTNT_DIM P,dbo.SRC_DIM B, dbo.TM_DIM C
WHERE CONVERT(DATE,P.REG_DT_TM) = C.DT
AND P.SRC_ID = B.SRC_ID
AND P.SRC_ID =6
AND C.DT BETWEEN Convert(Date,'2009-01-01',20) AND Convert(Date,'2010-12-31',20)
--AND B.FCLTY_NM &q_strFilterBy
GROUP BY B.SRC_ID,B.FCLTY_NM
ORDER BY PATREG DESC
As per the above example, i need the underlined and bolded dates to be runtime parameters like &startdate and &enddate in oracle. So according to that I must be able to get the data. Please help me, urgent.