Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL 7.0 vs 8.0
Message
From
16/04/2003 14:12:42
 
 
To
16/04/2003 11:16:45
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00777961
Message ID:
00778492
Views:
35
>>>
SELECT Appointments.app_time, Appointments.app_date,;
>>>   Appointments.pat_last;
>>>  FROM appointments;
>>>  where appointments.app_date >= mquerydate .AND.;
>>>  appointments.app_date <= mquerydate + 8;
>>>  GROUP BY Appointments.app_time, Appointments.app_date;
>>>  ORDER BY Appointments.app_time, Appointments.app_date;
>>>  INTO CURSOR existingappoints nofilter
>>>
>>>And sice this code does not contain aggregate functions the GROUP BY clause should include Appointments.pat_last?
>>
>>Nobody's asked the really important question here. Why do you have a GROUP BY clause when there are no aggregate functions? Generally, the whole point of grouping is to find the total or the average or the count or the minimum or maximum value of some field or fields across the group. What are you really trying to do here?
>>
>Following this select statement, if records exist, a DO GENXTAB WITH 'Appmatrix' where appmatrix is a table.
>
>The final outcome is a display of appointments, by time and date for 7 days at a time, for one doctor or for all doctors in the office.

Either I missed it or you haven't said what Pat_last represents, but it seems to me that you could either use MAX() or MIN() on the field to narrow it down to a particular record, or add it to the GROUP BY clause.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform