Hi all,
Something which I feel would have been relatively easy seems to not be coming out the way I wish.
I am using the following sql to query how many nonconformances have occured by month and at what cost.
I am trying to order the dates by oldest to newest. However I get the following output (I threw in feb1986 just to prove to myself it was wrong):
As you can see the timeline is not in the correct order. I can see the sql doesnt look quite right as there isn't an actual order to say go ascending/descending so I assume it is how I have tried to format DteOccur which is a Short Date to get it to month/year.
Anyone able to clarify how this should be done correctly.
Thanks,
Chris
Something which I feel would have been relatively easy seems to not be coming out the way I wish.
I am using the following sql to query how many nonconformances have occured by month and at what cost.
Code:
SELECT Count(tbllog.NCC_ID) AS NCCS, Sum(tblCosts.CostFig) AS SumOfCostFig, Format([DteOccur],"mmmm" & "yyyy") AS TimeLine FROM tbllog LEFT JOIN tblCosts ON tbllog.NCC_ID = tblCosts.NCC_ID GROUP BY Format([DteOccur],"mmmm" & "yyyy") ORDER BY Format([DteOccur],"mmmm" & "yyyy");
Code:
NCCS SumOfCostFig TimeLine 5 £33,234.00 August2010 10 February1986 1 £30,000.00 February2010 4 £3,790.00 July2010 7 £985.00 June2010 1 £50,000.00 March2010 2 £5,700.00 May2010
Anyone able to clarify how this should be done correctly.
Thanks,
Chris
Comment