P
Phil Smith
I thought this was simple. Apparently Not.
Here is my sample data:
Item ID Version PLM Brand
280 0 blank OJK
281 0 red Bulls
281 1 green BullS
317 0 red Ricter
317 1 blue Ricter
320 0 orange Dependent
320 1 Blue Dependent
320 2 Red Dependent
For each group of ITEM IDs, I want the Version,PLM, and BRAND for the
record with the highest Version #. Like So:
Item ID Version PLM Brand
280 0 blank OJK
281 1 green BullS
317 1 blue Ricter
320 2 Red Dependent
My query:
SELECT [PLMDATA].[Item ID], Last([PLMDATA].Version) AS Version,
Last([PLMDATA].PLM) AS PLM, Last([PLMDATA].Brand) AS Brand
FROM [PLMDATA]
GROUP BY [PLMDATA].[Item ID]
ORDER BY [PLMDATA].[Item ID], Last([PLMDATA].Version);
Gives Me Version "0" for every Item ID.
What am I doing wrong?
Here is my sample data:
Item ID Version PLM Brand
280 0 blank OJK
281 0 red Bulls
281 1 green BullS
317 0 red Ricter
317 1 blue Ricter
320 0 orange Dependent
320 1 Blue Dependent
320 2 Red Dependent
For each group of ITEM IDs, I want the Version,PLM, and BRAND for the
record with the highest Version #. Like So:
Item ID Version PLM Brand
280 0 blank OJK
281 1 green BullS
317 1 blue Ricter
320 2 Red Dependent
My query:
SELECT [PLMDATA].[Item ID], Last([PLMDATA].Version) AS Version,
Last([PLMDATA].PLM) AS PLM, Last([PLMDATA].Brand) AS Brand
FROM [PLMDATA]
GROUP BY [PLMDATA].[Item ID]
ORDER BY [PLMDATA].[Item ID], Last([PLMDATA].Version);
Gives Me Version "0" for every Item ID.
What am I doing wrong?