I have built the query below with the query builder, it works listing all the records I specified - however,
A couple of problems, if I car has been invoiced, credited then re-invoiced there will be two invoices in the table both will have the same stock number so how can I group these into one record?
Second problem is rather than a list I want a count of the number of records, i've been playing around with this in query builder for a while now and keep getting an error message about "aggregate functions"
Pls help!
SELECT CINVOICE.Type, CINVOICE.Date, CARS.[Stock Number], CARS.Type, CARS.Status
FROM CINVOICE INNER JOIN CARS ON CINVOICE.[Stock Number] = CARS.[Stock Number]
WHERE (((CINVOICE.Type)="invoice") AND ((CINVOICE.Date) Between [from] And [to]) AND ((CARS.Type)="trade") AND ((CARS.Status)="sold"))
ORDER BY CARS.[Stock Number];
A couple of problems, if I car has been invoiced, credited then re-invoiced there will be two invoices in the table both will have the same stock number so how can I group these into one record?
Second problem is rather than a list I want a count of the number of records, i've been playing around with this in query builder for a while now and keep getting an error message about "aggregate functions"
Pls help!
SELECT CINVOICE.Type, CINVOICE.Date, CARS.[Stock Number], CARS.Type, CARS.Status
FROM CINVOICE INNER JOIN CARS ON CINVOICE.[Stock Number] = CARS.[Stock Number]
WHERE (((CINVOICE.Type)="invoice") AND ((CINVOICE.Date) Between [from] And [to]) AND ((CARS.Type)="trade") AND ((CARS.Status)="sold"))
ORDER BY CARS.[Stock Number];