The problem in the UNION is that it automatically makes a DISTINCT list
of results...
Thus, it is cleaner to create two separate SELECT - SQL results, then
append one result to another afterwards.
Philip
Desmond Lloyd wrote:
Help!
Am attempting to summarize employee hours coming from two separate
files, current and history.
The following statement works when summarizing time reported for
employees.
mfilt is a "built" where clause, primarily defining a date range. (in
this case 08/04)
set enginebehavior is set to 70 because it balks at my sum(time)
statements, "group by is invalid"
Select prempl,date,Sum(time) as time_total, From current_labor &mfilt ;
union
Select prempl,date,Sum(time) as time_total, From history_labor &mfilt
into Cursor whatever
Works fine for all employees except for one, where the time_total is
equal on both sides. Changing one of the totals if I separate out the
"current" and "history" cursors allows that employee to calculate
properly. For the one employee it only selects one record, if I
change one of the totals I get two???
Hope this makes sense.
Any suggestions?
TIA,
Desmond
8-)
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.