Thread: QUERY SYNTAX
View Single Post
 
Old September 9th, 2003, 07:29 AM
singh_ginni singh_ginni is offline
Registered User
 
Join Date: Sep 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default QUERY SYNTAX

Dear All,
Kindly help me to correct the syntax of the query. Also could any one explain why i am not able to see error after i compile this code in Oracle DBA Studio. The error window is always blank(really annoyed with DBA Studio behavior).

-----------------------QUERY BELOW-----------------------------------



PROCEDURE "STATUSTIME" (startDate DATE,endDate DATE)

AS
BEGIN
SELECT
  CASE
    WHEN startDate > yrMth THEN startDate
         ELSE yrMth END || ' - '||
  CASE
    WHEN endDate < LAST_DAY(yrMth)
    THEN endDate
    ELSE LAST_DAY(yrMth) END AS DateofComplaint,
          TotalComplaint AS TotalComplaint
          FROM

              (SELECT TO_DATE('01-'||SUBSTR(TO_DATE(ACTIVITYSTARTTIME, 'DD/MM/YY'),4),'DD/MM/YY') as yrMth,count(CURRENTACTIVITY) AS TotalComplaint
                  FROM TRXCOMPLOG
                  WHERE ACTIVITYSTARTTIME BETWEEN TO_DATE('21/06/2003','DD/MM/YY') AND TO_DATE('21/12/2003','DD/MM/YY')
                  AND CURRENTACTIVITY='new'
                  group by TO_DATE('01-'||SUBSTR(TO_DATE(ACTIVITYSTARTTIME, 'DD/MM/YY'),4),'DD/MM/YY'));

END STATUSTIME;

-----------------------------------------------------------


Any help shall be much appreciated

Regards,
Ginni