A
Art Marks
I'm trying to create a chart in Access that graphs change in body weight
(and other fields that I've left out for simplicity) from a certain start
date. I had originally hard coded the start weight, but for flexibility as
to the start date I tried using First([Weight]). Problem is that I'm
grouping by date so instead of returning the weight on the date in the WHERE
clause, I'm getting the first weight per day. How do I correct the SQL?
Thanks
--Art
SELECT (Format([Date],"DDDDD")), Avg([Weight])-First([Weight]) AS [Change in
Weight]
FROM [logWeight]
WHERE [Date] >= #10/10/04#
GROUP BY (Int([Date])),(Format([Date],"DDDDD"));
(and other fields that I've left out for simplicity) from a certain start
date. I had originally hard coded the start weight, but for flexibility as
to the start date I tried using First([Weight]). Problem is that I'm
grouping by date so instead of returning the weight on the date in the WHERE
clause, I'm getting the first weight per day. How do I correct the SQL?
Thanks
--Art
SELECT (Format([Date],"DDDDD")), Avg([Weight])-First([Weight]) AS [Change in
Weight]
FROM [logWeight]
WHERE [Date] >= #10/10/04#
GROUP BY (Int([Date])),(Format([Date],"DDDDD"));