Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

Append Query problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geoff - 13 Jan 2006 07:51 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.