473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Append Query problem

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
Jan 13 '06 #1
1 1549
Geoff, what happens if you drop the GROUP BY clause?

--
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.

"Geoff" <gf****@freenetname.co.uk> wrote in message
news:fJ******************************@brightview.c om...
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

Jan 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm trying to use a make table query to pull the last transactionID, so I can use an append query to reset the transactionID to the next...
7
by: | last post by:
I found similiar issues in MS-KB but nothing that helped me; got the Windows and Office updates from the MS website but that hasn't changed the behavior of this problem, and I don't see anything...
1
by: Aaron | last post by:
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; ...
1
by: Kristina | last post by:
I'm trying to run multiple append queries in an Access front end that append data from tables in a .mdb into tables in SQL Server 2000. My Access front end has a link to both tables, the .mdb and...
1
by: David Barger | last post by:
Greetings, It appears that an Append Query I run in Access XP is randomly failing to append a field. I have payroll data being entered into a payroll database. This data is exported daily to...
5
by: Michael C via AccessMonster.com | last post by:
Hello, I have a table that I am appending 3 seperate tables into. My main problem is that each time I append the data, it simply adds to the data already there. That might sound ok, except that...
1
by: James Hallam | last post by:
I have a form with a subform. When there are no entries in the subform, I have an append query which makes a default entry in the subform (for what I am doing there needs to be at least one value...
4
by: pmacdiddie | last post by:
I have an append query that needs to run every time a line item is added to a subform. The append writes to a table that is the source for a pull down box. Problem is that it takes 5 seconds to...
7
by: wade.wall | last post by:
Hi all, I am having a problem appending data to an existing table. I have two tables with identical fields and I want to append the data from one table (T2) to the first (T1). T1 has 136...
4
by: Scott12345 | last post by:
Hi, here is my situation, I have a DB that tracks machine downtime (30 machines) per day. Several users will update this through the day. I created an append query that creates 30 dummy values and...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.