473,545 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need A97 code/query help.

pw
Hi,

I am having a mental block trying to figure out how to code this.

Two tables:

"tblQuestio ns" (fields = quesnum, questype, question)
"tblAnswers " (fields = clientnum, quesnum, questype, answer)

They are related by quesnum and questype. There are records in
tblAnswers for multiple clientnums.

What I need to do is to get every record from tblQuestions into the
tblAnswers table for every clientnum that is in the tblAnswer table.

Rats, I thought by typing out the problem I would have solved it but
nothing! :-)

Any ideas?
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #1
3 1848
pw <***paulwilliam son@***spamcop. net> wrote in
news:tu******** *************** *********@4ax.c om:
Hi,

I am having a mental block trying to figure out how to code
this.

Two tables:

"tblQuestio ns" (fields = quesnum, questype, question)
"tblAnswers " (fields = clientnum, quesnum, questype, answer)

They are related by quesnum and questype. There are records
in tblAnswers for multiple clientnums.

What I need to do is to get every record from tblQuestions
into the tblAnswers table for every clientnum that is in the
tblAnswer table. Rats, I thought by typing out the problem I would have solved
it but nothing! :-)

Any ideas?
Before I tell you how, I'm gonna tell you "Don't do it!'
You can just create the select queries and use it instead of
doing the additional steps.

First thing to do is create a select query with unique clientnum
as a parameter, and the tblquestions, then create a second query
with this query left joined to the tblAnswers on clientinum and
quesnum. You should not need any join on questype.

run the query, and note that you have all the questions and that
the unanswered questions have nothing in the answer field.

That's as far as you need to go.
Now to actually add the fields into the answers table, create a
new query with only the clientnum field, and the distinct values
property set to yes.

open the first select query, add the query with the clientnum
field, and change the original clientnum parameter to the
clientnum field. don't make any relation to the new field,

Now go to the second query, and add a condition to the answer
field, type IS NULL. without quotes.

If you run this query now, you will see a list of all the
unanswered clientnum-quesnum combinations.

Now create an append query based on this query that writes the
clientnum, quesnum, questype and "NO ANSWER" to the tblanswers.
Bob Quintal
..

-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure
Usenet News==---- http://www.newsfeed.com The #1 Newsgroup
Service in the World! >100,000 Newsgroups ---= 19
East/West-Coast Specialized Servers - Total Privacy via
Encryption =---


Nov 12 '05 #2
pw
>pw <***paulwilliam son@***spamcop. net> wrote in
news:tu******* *************** **********@4ax. com:
Hi,

I am having a mental block trying to figure out how to code
this.

Two tables:

"tblQuestio ns" (fields = quesnum, questype, question)
"tblAnswers " (fields = clientnum, quesnum, questype, answer)

They are related by quesnum and questype. There are records
in tblAnswers for multiple clientnums.

What I need to do is to get every record from tblQuestions
into the tblAnswers table for every clientnum that is in the
tblAnswer table.
Rats, I thought by typing out the problem I would have solved
it but nothing! :-)

Any ideas?


Hi Bob!
Before I tell you how, I'm gonna tell you "Don't do it!'
I was hoping someone would show me something different!!
You can just create the select queries and use it instead of
doing the additional steps.

Nice! My weakness! Always writing code I am! That is one great
feature about Access that I love: The query builder!
First thing to do is create a select query with unique clientnum
as a parameter, and the tblquestions, then create a second query
with this query left joined to the tblAnswers on clientinum and
quesnum. You should not need any join on questype.

run the query, and note that you have all the questions and that
the unanswered questions have nothing in the answer field.

That's as far as you need to go.


Sounds good!
Now to actually add the fields into the answers table, create a
new query with only the clientnum field, and the distinct values
property set to yes.

open the first select query, add the query with the clientnum
field, and change the original clientnum parameter to the
clientnum field. don't make any relation to the new field,

Now go to the second query, and add a condition to the answer
field, type IS NULL. without quotes.

If you run this query now, you will see a list of all the
unanswered clientnum-quesnum combinations.

Now create an append query based on this query that writes the
clientnum, quesnum, questype and "NO ANSWER" to the tblanswers.
Bob Quintal
.


This is good stuff Bob! I'll try it out 1st thing in the morning.
Thanks a lot!

-paul
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #3
pw
Hi Bob
Before I tell you how, I'm gonna tell you "Don't do it!'
You can just create the select queries and use it instead of
doing the additional steps.

First thing to do is create a select query with unique clientnum
as a parameter, and the tblquestions,


I don't know how to specify a unique field in the Access97 Query
designer.
then create a second query
with this query left joined to the tblAnswers on clientinum and
quesnum. You should not need any join on questype.
clientnum is only in the answers table so I can't join on it.


run the query, and note that you have all the questions and that
the unanswered questions have nothing in the answer field.

That's as far as you need to go.
Now to actually add the fields into the answers table, create a
new query with only the clientnum field, and the distinct values
property set to yes.

I don't have a distinct value property in the Access 97 query
designer.

Thanks,
open the first select query, add the query with the clientnum
field, and change the original clientnum parameter to the
clientnum field. don't make any relation to the new field,

Now go to the second query, and add a condition to the answer
field, type IS NULL. without quotes.

If you run this query now, you will see a list of all the
unanswered clientnum-quesnum combinations.

Now create an append query based on this query that writes the
clientnum, quesnum, questype and "NO ANSWER" to the tblanswers.
Bob Quintal
.

-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure
Usenet News==---- http://www.newsfeed.com The #1 Newsgroup
Service in the World! >100,000 Newsgroups ---= 19
East/West-Coast Specialized Servers - Total Privacy via
Encryption =---


-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #4

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

Similar topics

2
3040
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers to have an easier time understanding what I do. Therefore this weekend I'm going to spend 3 days just writing comments. Before I do it, I thought...
12
2381
by: jason | last post by:
Access 2000: I have a customer-inventory table I need to loop through and compile a list of all the inventory items the customer is tracking. The problem I am finding is that a simple loop will pull out the customer details each time their is an inventory item listed....I need to get the customer out ONCE and list his items....is there an...
9
3114
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use SUBSTRING(ProductName, 1, CHARINDEX('(', ProductName)-2). I can get this result, but I had to use several views (totally inefficient). I think this can be...
9
2913
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the...
2
3501
by: Paul Mendez | last post by:
I really need some help Date Code ConCAT Bal_Fwd NS_Fees Amt_Coll Cur_End_Bal 1/15/2004 KW 11KW2003 $500.00 $250.00 $250.00 2/15/2004 KW 12KW2003 $300.00 $500.00 -$200.00 3/15/2004 KW 1KW2004 ???? $123.00 $584.00 -$461.00 4/15/2001 KW 2KW2004 XXXX $223.00 $484.00 -$261.00...
3
10616
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems that are hard to find. The main problem I am having right now is that I have a report that is sorted by one of these lookup fields and it only displays...
8
2070
by: pamelafluente | last post by:
I am beginning aspNet, I know well win apps. Need a simple and schematic code example to start work. This is what I need to accomplish: ---------------------- Given button and a TextBox on a web form when one presses the button on the web form on a client pc, the sql query which is contained in the text box is sent to a vb net...
1
1695
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: id ------------ name
0
955
by: savage678 | last post by:
Hi Everyone, I am new to this forum and am i dire need of some help. I am trying to use wildcard searches in infopath. I have it connected to an access database using data connection. I have some code which will allow me to do it but i dont know how to change the code. Could someone please help me. I have added the code for you to. ...
0
7468
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.