[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

To Break or not to Break



I have a little dilemna and I hope someone can help me. The end user would like an option to have a report not sort by department. I
know how to get around the order by part but I'm not sure what to do about the on-break processing. I would like to make the on-break dynamic. Attached is the code. Any help would be much appreciated. I am using SQR V3.013.3.
 
Thanks
Norm
 
! check if all Plans (ie: not sort by department)
  if $Plans_Selected = 'ALL'
     let $Order_By = 'ORDER BY A.COMPANY, C.DEPTID, B.Name, A.EMPLID, A.PLAN_TYPE'
   else
    let $Order_By = 'ORDER BY A.COMPANY, B.Name, A.EMPLID, A.PLAN_TYPE'
   end-if

begin-SELECT 
A.COMPANY      () on-break print=never level=1 procedure=Company-Change
C.DEPTID           () on-break print=never level=2 procedure=Dept-Change
A.EMPLID,
...
FROM PS_LEAVE_ACCRUAL A,
     PS_PERSONAL_DATA B,
     PS_JOB           C,
     PS_LEAVE_PLAN    D,
     PS_Employment    E,
     PS_Benef_Plan_Tbl F
WHERE ......
[$Order_By]
end-SELECT