2 Replies Latest reply on May 25, 2015 1:32 PM by DLopez

    remove date from group by

    DLopez

      Hi,

       

      I have created this query and I need the date attribute (StartDate) but i can't have it group by that attribute.

      Is there a way to don't group by startdate?

      thk

      SELECT GSP_COMPLEX.NAME AS complex,
      GSP_COMPLEX.RECID AS RecId,
      GSP_BOOKING.STARTDATE AS BeginDate,
       COUNT(GSP_BOOKING.RECID) AS total
      FROM GSP_BOOKING, GSP_FACILITY, GSP_ROOM, GSP_COMPLEX, GSP_STAFF
      WHERE GSP_BOOKING.FACILITYID = GSP_FACILITY.RECID
      AND GSP_BOOKING.ROOMID = GSP_ROOM.RECID
       AND GSP_BOOKING.CUSTOMERID IN (SELECT recid FROM customer c WHERE (recid =:vCurrentRecID AND :search_type IN (0,1) ) OR (c.recid = (SELECT parentid FROM customer c WHERE recid=:vCurrentRecID ) 
       AND GSP_BOOKING.STAFFID = GSP_STAFF.RECID
       AND GSP_BOOKING.CPLXID  = GSP_COMPLEX.RECID
      GROUP BY GSP_COMPLEX.NAME,
      GSP_COMPLEX.RECID,
       GSP_BOOKING.STARTDATE
      ORDER BY complex ASC