Hello,
I am trying t create a view where I am summing up a bunch of number then group location and items. What I am also trying to do is grab the first cost that is attached to my first record and store it for each item and location.
here is my select statement. Let me know if there is something I can do.
Thanks
SELECT some.intnum, activity.item, activity.location,
SUM(activity.qty1 + activity.qty3 + activity.qty5)
AS quantitychanged,
SUM(activity.value1 + activity.value3 + activity.value5)
AS valuechanged, cost( here is where I need to be able to grab first cost for each item and location and I am not sure how to do it)
FROM some INNER JOIN
activity ON activity.postdate > some.date2
GROUP BY activity.location,activity.item, some.intnum
I am trying t create a view where I am summing up a bunch of number then group location and items. What I am also trying to do is grab the first cost that is attached to my first record and store it for each item and location.
here is my select statement. Let me know if there is something I can do.
Thanks
SELECT some.intnum, activity.item, activity.location,
SUM(activity.qty1 + activity.qty3 + activity.qty5)
AS quantitychanged,
SUM(activity.value1 + activity.value3 + activity.value5)
AS valuechanged, cost( here is where I need to be able to grab first cost for each item and location and I am not sure how to do it)
FROM some INNER JOIN
activity ON activity.postdate > some.date2
GROUP BY activity.location,activity.item, some.intnum