473,378 Members | 1,470 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,378 software developers and data experts.

Entering a 0 value in a table as a result of a query

Hi
This has taken me ages to work out but i'm sure there is a simple
explanation and somebody here will be able to help. I'll talk you
through it as best i can:

1. User enters dates on an initial form
2. This then opens up another form asking for shift colour
(red/blue/green) and times shift start and end on dates entered in 1st
form.
3. This is where the problem starts...I have set up queries to
capture faults in products by area eg. qa, supplier, production!
Therefore i have set up an append query to enter date (from 1st form)
for defects between dates (second form) and with shift (second
form)and faults "qa" for example. This is all working fine until
there are no faults for qa on that date between those times.
Obviously no results will come up because there are no faults, this
however is not what i want. I have to run a report of these results
and this contains charts with date along the x axis and count of
defects as the values. Therefore i still need the date and shifts to
be entered in the table along with a 0 value for "qa" defects instead
of no entry at all.

Long and short of the problem is.....i need the query to come back
with a zero result displaying date and shift rather than returning no
entries.

All help is greatly appreciated. Thanks in advance.
Paul
Nov 13 '05 #1
5 1467
You have been using an INNER JOIN. You will need to use another type of
JOIN in the query, to get results from all of table A, even when there is no
match from table B. Access query by design will help, or look up LEFT JOIN
and RIGHT JOIN.
Darryl Kerkeslager
"Paul" <pa*************@student.shu.ac.uk> wrote:
Long and short of the problem is.....i need the query to come back
with a zero result displaying date and shift rather than returning no
entries.

Nov 13 '05 #2
Thanks for that, will come in handy in the future but not sure it solves
my problem now!

At the moment the date and shift are entered in the form and not stored
in the table until the append query is run (at which point all these
details and number of faults are entered) I therefore can't change the
type of join as there is only one table and all other data is retreived
straight from the form. Is the only way around this to have the data
from the form entered directly into a table and then run an update query
on it? I'd rather not do this if there is another option.

Thanks
Paul
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3
First off, there is almost always more than one way to do anything in
Access. Finding the best way is the difficulty.

I re-read your first post, with your second, and maybe I don't have enough
information. Could you post the append query? Also, you said in your first
post, "I need the query to come back with a zero result displaying date and
shift". What query is this? Can you post it?

Without seeing more, the only thing I can offer is for you to look at the
nz() function, which accepts a value which may be NULL, and returns a string
or numeric value if NULL.
Darryl Kerkeslager

"paul shepherd" <pa*************@student.shu.ac.uk> wrote:
At the moment the date and shift are entered in the form and not stored
in the table until the append query is run (at which point all these
details and number of faults are entered) I therefore can't change the
type of join as there is only one table and all other data is retreived
straight from the form. Is the only way around this to have the data
from the form entered directly into a table and then run an update query
on it? I'd rather not do this if there is another option.

Nov 13 '05 #4
"Darryl Kerkeslager" <Ke*********@comcast.net> wrote in
news:a_********************@comcast.com:
First off, there is almost always more than one way to do
anything in Access. Finding the best way is the difficulty.

I re-read your first post, with your second, and maybe I don't
have enough information. Could you post the append query?
Also, you said in your first post, "I need the query to come
back with a zero result displaying date and shift". What
query is this? Can you post it?

Without seeing more, the only thing I can offer is for you to
look at the nz() function, which accepts a value which may be
NULL, and returns a string or numeric value if NULL.
Darryl Kerkeslager

"paul shepherd" <pa*************@student.shu.ac.uk> wrote:
At the moment the date and shift are entered in the form and
not stored in the table until the append query is run (at
which point all these details and number of faults are
entered) I therefore can't change the type of join as there
is only one table and all other data is retreived straight
from the form. Is the only way around this to have the data
from the form entered directly into a table and then run an
update query on it? I'd rather not do this if there is
another option.


The issue that Paul has is that he needs to create entries for
dates where no record exists in his table. The solution is to
first create records for the date and shift, bassed on code, then
do an update query of those records which match the created
records.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #5
Yeah Bob's right, i need to create records for date and shift where
there are no entries. Probably would've been easier to understand if
i'd worded it like that from the start. I've succeeded anyway, after
reading your first reply about the type of joins, i now create a table
when date and shift are entered and then update it with the fault
information. Not an ideal way, but like you say, there are many
different ways to do things in access and this way works.

Thanks for your help, its been much appreciated.
Paul

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #6

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

Similar topics

4
by: Bruce A. Julseth | last post by:
I know the following $sql will fail since there is no Customer='Smith'. I want to determine how to test a failure of mysql_query. I thought mysql_query returned false if a query failed. The test...
4
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
5
by: Aaron C | last post by:
Hi, I'm trying to do an insert with the following statement: INSERT INTO user VALUES ( 'ag@ag.com','ag','Aaron','Chandler','','','La Mirada','CA',90638,714,'',''); and I'm getting the error...
2
by: Rose | last post by:
I have a transactions table with a field named Transaction. I want Transaction to be positive for input and negative for outflow. How do I set up the form for entering outflow so for data entry,...
4
by: so many sites so little time | last post by:
ok so i am having problems if you look at the script below you will see that it the query has 4 values to insert but the actual values only contain title entry and now() for the date. well i have...
0
MMcCarthy
by: MMcCarthy | last post by:
This is a module that imports information to a Query or a Table from comma separated values file in a text format! It is very helpful for getting information from other applications and from files! ...
6
flexsingh
by: flexsingh | last post by:
Hello there, I have constructed a option of choosing a court only available when member no = "0". This works fine and is in the first code: - <html> <head> </head> <body background="main...
4
by: Neil | last post by:
Having trouble with inserting a record into a table. It's a list of names. But, for some reason, it won't take a particular name. When a user tries to enter a name into the table, the system hangs...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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...

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.