Viewing 3 posts - 1 through 3 (of 3 total)
Perfect - thank you.
Your help is greatly appreciated.
May 17, 2016 at 9:52 am
Perfect thanks.
One last bit, can I give an alias of 'MPG' to the calculation part?
SUM(J.JourneyDistanceMiles) AS Mileage,
SUM(J.JourneyTotalFuelUsed)*0.219969157 AS Fuel,
SUM(J.JourneyDistanceMiles) / NULLIF((SUM(J.JourneyTotalFuelUsed)*0.219969157),0) AS [SUM(J.JourneyDistanceMiles)/SUM(J.JourneyTotalFuelUsed)*0.219969157 AS MPG]
May 17, 2016 at 9:41 am
This gives me a divide by zero error? (in reply to Eirikur Eiriksson)
I assume i need to remove the bits in brackets so my statement reads:-
SUM(J.JourneyDistanceMiles) AS Mileage,
SUM(J.JourneyTotalFuelUsed)*0.219969157 AS Fuel,
SUM(J.JourneyDistanceMiles)...
May 17, 2016 at 9:25 am
Viewing 3 posts - 1 through 3 (of 3 total)