FPSQL

Walter D Vaughan Jr wvaughan at steelerubber.com
Thu Oct 31 14:42:19 PDT 2013



> -----Original Message-----
> From:  Richard Kreiss
> Sent: Thursday, October 31, 2013 5:27 PM
> To: filepro-list at lists.celestial.com; Fp Support (fpsupport at fptech.com)
> Subject: Re: FPSQL
> 
> 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

[Walter D Vaughan Jr] 

Well that code can't  be right. 
Your "group by" cannot be right for that result list, or fpSQL follows
limited sequel standards and I cannot help you.




More information about the Filepro-list mailing list