I am currently working on an Access 2010 project and I am having some trouble with the expression builder. I have to populate 5 fields using the sum function. I have attached a screenshot of the report for a better idea.
The following 5 fields (Passenger, Agricultural, Truck, ATV and Forklift) need to be populated the "TotalPTE" sum of each respective tire type.
To do this, I wrote 5 different queries which I use in the Expression Builder to get the SUM of the Total PTE for each.
here is the query:
Expand|Select|Wrap|Line Numbers
- SELECT ScrapTireType.PTEamount,
- ScrapTireType.description,
- ScrapCollectionTireType.amount,
- ScrapCollection.regNum,
- ScrapCollection.invoiceNum,
- ScrapCollection.Date,
- ScrapCollection.driverSigned,
- ScrapCollection.retailerSigned,
- ScrapCollection.PTEtotal,
- ScrapCollection.scrapCollectionID
- FROM ScrapCollection
- INNER JOIN (ScrapTireType
- INNER JOIN ScrapCollectionTireType
- ON (ScrapTireType.scrapTireTypeID = ScrapCollectionTireType.scrapTireTypeID)
- AND (ScrapTireType.scrapTireTypeID = ScrapCollectionTireType.scrapTireTypeID))
- ON ScrapCollection.scrapCollectionID = ScrapCollectionTireType.scrapCollectionID
- WHERE (((ScrapTireType.PTEamount)=[Reports]![RPTEDetailsEndDate]![amount])
- AND ((ScrapTireType.description)="Passenger")
- AND ((ScrapCollection.regNum)=[Forms]![PTEDetailsNew]![regNum])
- AND ((ScrapCollection.Date)<=[Forms]![PTEDetailsNew]![endDate]))
- ORDER BY ScrapCollection.Date DESC;
I would really appreciate any help. I don't want to be prompted for the amount when the query returns it with no problem.
Thank you