I am running an append query using query by example (but included equivalent
SQL code). The query counts the number of bookings and appends this number
to bookings to Tbl_Weekly
INSERT INTO Tbl_Weekly ( NoofBooks, StartDate, EndDate )
SELECT Count(Bookings.DateofEvent) AS Noofbook, Forms!Printouts!WSdate AS
WeekStart, Forms!Printouts!WEdate AS WeekEnd
FROM Bookings
WHERE (((Bookings.DateofEvent)>[Forms]![Printouts]![WSdate] And
(Bookings.DateofEvent)<([Forms]![Printouts]![WEDate])))
GROUP BY Forms!Printouts!WSdate, Forms!Printouts!WEdate;
It works but...when the Count is 0 no record is appended. However I want to
append a zero count as well (ie 0,StartDate, EndDate). Any ideas?
Any help would be greatfully received
Regards
Geoff
Allen Browne - 13 Jan 2006 08:18 GMT
Geoff, what happens if you drop the GROUP BY clause?

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>I am running an append query using query by example (but included
>equivalent SQL code). The query counts the number of bookings and appends
[quoted text clipped - 14 lines]
> Regards
> Geoff