E
Ernesto
Hello all...need some help with this...
I have a table with the following data...
ID Date Description Price Cost
1 03/01/06 Item 1 10.5 5.5
1 03/05/06 Item 1 11.36 6.75
3 03/06/06 Item 2 9.25 3.69
3 04/15/06 Item 2 11.45 4.89
5 04/15/06 Item 3 9.45 2.25
I'd like to be able to get the lastest Description, Price, and Cost by
month...like this...
ID Date Description Price Cost
1 03/05/06 Item 1 11.36 6.75
3 04/15/06 Item 2 11.45 4.89
5 04/15/06 Item 3 9.45 2.25
I've tried the following:
SELECT table.ID, Max(tblPST_Changes.Date) AS MaxOfDate,
table.Description, table.Price, table.Cost
FROM table
GROUP BY table.ID, table.Description, table.Price, table.Cost
but when I run the above query it returns this...
ID Date Description Price Cost
1 03/01/06 Item 1 10.5 5.5
1 03/05/06 Item 1 11.36 6.75
3 03/06/06 Item 2 9.25 3.69
3 04/15/06 Item 2 11.45 4.89
5 04/15/06 Item 3 9.45 2.25
why is it returning everything in the table?
help would be greatly appreciated....
peace!
I have a table with the following data...
ID Date Description Price Cost
1 03/01/06 Item 1 10.5 5.5
1 03/05/06 Item 1 11.36 6.75
3 03/06/06 Item 2 9.25 3.69
3 04/15/06 Item 2 11.45 4.89
5 04/15/06 Item 3 9.45 2.25
I'd like to be able to get the lastest Description, Price, and Cost by
month...like this...
ID Date Description Price Cost
1 03/05/06 Item 1 11.36 6.75
3 04/15/06 Item 2 11.45 4.89
5 04/15/06 Item 3 9.45 2.25
I've tried the following:
SELECT table.ID, Max(tblPST_Changes.Date) AS MaxOfDate,
table.Description, table.Price, table.Cost
FROM table
GROUP BY table.ID, table.Description, table.Price, table.Cost
but when I run the above query it returns this...
ID Date Description Price Cost
1 03/01/06 Item 1 10.5 5.5
1 03/05/06 Item 1 11.36 6.75
3 03/06/06 Item 2 9.25 3.69
3 04/15/06 Item 2 11.45 4.89
5 04/15/06 Item 3 9.45 2.25
why is it returning everything in the table?
help would be greatly appreciated....
peace!