Hmm. Assuming:
You could join both'em with outer join:
[code]
SELECT [1st].MeterID, [1st].Usage - [2nd].SubGaugesTotal AS MainMeterNettoU sage FROM [1st] LEFT JOIN [2nd] ON [1st].MeterID=[2nd].MainMeterOD;
[/cope]
P.S. The formula really impresses. :D Couldn't cope with it because there were !@#%!@$% many characters where.
- Both queries perform as expected.
- The 1st query returns "brutto" usage of all gauges (1 record per gauge).
- The 2nd return subgauges totals (1 record per main guage).
You could join both'em with outer join:
[code]
SELECT [1st].MeterID, [1st].Usage - [2nd].SubGaugesTotal AS MainMeterNettoU sage FROM [1st] LEFT JOIN [2nd] ON [1st].MeterID=[2nd].MainMeterOD;
[/cope]
P.S. The formula really impresses. :D Couldn't cope with it because there were !@#%!@$% many characters where.
Comment