I have the following SQL statement
SELECT DISTINCT CARS.[Stock Number], CARS.Make, CARS.Model, CARS.Registration, CARS.ReCon1, CARS.[RC Cost1], CARS.ReCon2, CARS.[RC Cost2], CARS.ReCon3, CARS.[RC Cost3], CARS.ReCon4, CARS.[RC Cost4], CARS.ReCon5, CARS.[RC Cost5], CARS.ReCon6, CARS.[RC Cost6], CINVOICE.Date, [rc cost1]+[rc cost2]+[rc cost3]+[rc cost4]+[rc cost5]+[rc cost6] AS Expr1
FROM CARS INNER JOIN CINVOICE ON CARS.[Stock Number]=CINVOICE.[Stock Number]
WHERE (((CINVOICE.Date) Between Forms!Form2!start And forms!form2!end) And ((CARS.Status)="sold"));
I added the DISTINCT keyword myself however the query still returns duplicates, do I need to add it anywhere else? I want only one of any Stock Number in my query.
Thanks
SELECT DISTINCT CARS.[Stock Number], CARS.Make, CARS.Model, CARS.Registration, CARS.ReCon1, CARS.[RC Cost1], CARS.ReCon2, CARS.[RC Cost2], CARS.ReCon3, CARS.[RC Cost3], CARS.ReCon4, CARS.[RC Cost4], CARS.ReCon5, CARS.[RC Cost5], CARS.ReCon6, CARS.[RC Cost6], CINVOICE.Date, [rc cost1]+[rc cost2]+[rc cost3]+[rc cost4]+[rc cost5]+[rc cost6] AS Expr1
FROM CARS INNER JOIN CINVOICE ON CARS.[Stock Number]=CINVOICE.[Stock Number]
WHERE (((CINVOICE.Date) Between Forms!Form2!start And forms!form2!end) And ((CARS.Status)="sold"));
I added the DISTINCT keyword myself however the query still returns duplicates, do I need to add it anywhere else? I want only one of any Stock Number in my query.
Thanks