|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have table with this fields:
Article_ID, Date_In, Q_In, Date_Out, Q_Out I need query (report) that will show only the last Date_In and the last Date_Out for each Article_ID. I think the solution is in the filter with Dmax function.I find out how to use this function in form (using VBA) but I just don't get it how this works in query. The records looks like this: Article_ID,Date_In, Q_In,Date_Out,Q_Out cu001 01/05/05 55 0 0 cu002 02/05/05 30 0 0 cu001 0 0 05/05/05 20 cu002 0 0 08/05/05 10 Any help will do.Thanks |
|
#2
|
|||
|
|||
|
I find out the solution that will give me the last Date_IN for every Article_ID. So my suggestion is to split this problem in two queries (one for Date_IN and one for Date_out) and then insert it new table . Maybe there is a better solution but this one worked for me (the amount of quantities is not important for me and the query gives the sum )
SELECT DISTINCTROW TableName.Article_ID, Max(TableName.Date_IN) AS MaxOfDate_IN, Sum(TableName.Q_IN) AS [Sum Of Q_IN] FROM Tablename GROUP BY TableName.Article_ID; |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Dmax problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|