FPSQL

Richard Kreiss rkreiss at gccconsulting.net
Thu Oct 31 14:27:17 PDT 2013


I have the following query

select
     Doc_code 'Code',
     l_doctor.Last_name 'Name',
     Event_date 'Date',
     Time,
     AMPM '',
     count(*) 'Patients',
     sum(@10) 'Guests',
     count(*)+sum(@10) 'total'
>From patient_events, l_doctor
where
      doc_code >= 1000 and doc_code < 9990
                and
      l_doctor.doc_code=doc_code
group by DOC_code,event_date,event_num

When run the results are:

Code Name                 Date       Time     Patients Guests     total
-----------------------------------------------------------------------
1066 Gorman               11/05/2013 09:30 AM       50     12        62
1066 Gorman               11/05/2013 12:00 PM       69     10        79
1096 Kerrigan             11/09/2013 10:00 AM       45      6        51
1762 Kingsbury            11/13/2013 05:00 PM       55     14        69
1762 Kingsbury            11/13/2013 07:00 PM       24      8        32
1822 Spivack              10/29/2013 05:00 PM      128     35       163
1822 Spivack              10/29/2013 07:00 PM       90     31       121
1877 Grossman             11/20/2013 05:00 PM       17      0        17
1877 Grossman             11/20/2013 07:00 PM        3      0         3


Is there a way to get a total for each Code or name?  i.e. Gorman 141


Richard Kreiss
GCC Consulting

Office: 410-653-2813







More information about the Filepro-list mailing list