mastersbsb
New member
- Local time
- Yesterday, 21:43
- Joined
- Jun 27, 2023
- Messages
- 1
I have a database in MS Access, which serves to store the trips from the cut to the embankment in an earthwork. In this database I have two tables, the CAD_CARGA table and the CAD_DESCARGA table, the following image shows the structures of both:
Basically what I need is a query with an INNER JOIN that matches the discharge with the respective load, that is, the loads with the same DATA, EQUIPMENTO_TRANSPORTE and MATERIAL. So far so good, I managed to do it. However, I have 33,800 records, but the query multiplies the lines, generates around 130,000 results, another way would be, in addition to the fields above, to use the HOUR field, which is common in both tables, that is, CAD_DESCARGA.HORA has to be the smallest value possible compared to CAD_LOAD.HORA, also satisfying the requirements of the same DATA, EQUIPMENTO_TRANSPORTE and MATERIAL. However I can't progress, could someone help me?
Basically what I need is a query with an INNER JOIN that matches the discharge with the respective load, that is, the loads with the same DATA, EQUIPMENTO_TRANSPORTE and MATERIAL. So far so good, I managed to do it. However, I have 33,800 records, but the query multiplies the lines, generates around 130,000 results, another way would be, in addition to the fields above, to use the HOUR field, which is common in both tables, that is, CAD_DESCARGA.HORA has to be the smallest value possible compared to CAD_LOAD.HORA, also satisfying the requirements of the same DATA, EQUIPMENTO_TRANSPORTE and MATERIAL. However I can't progress, could someone help me?