473,770 Members | 3,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to pull the correct answer from multiple choice questions database?

mb60
37 New Member
sir
In my database I have one column for question. Four columns are meant for options 1,2,3,4. The 5th column is YES/NO column.
The answers for the questions are entered into 5th column by a option box.
Now I would like to print a report with the questions and correct answers which are present in the 1,2,3,4 columns.
Example
Q) aaaaaaaaaaaaaaa aa
1) bbbbbbbb 2) cccccc 3) ddddd 4) eeeeeee
answer = 2

I would like to have the question answer in the report as given below
Q) aaaaaaaaaaaaaaa aa
answer = 2) cccccc

Thank you
Jan 25 '10 #1
7 4219
NeoPa
32,573 Recognized Expert Moderator MVP
I understand your question, but I have no reference points included from which to give you an answer. I would suggest using the function Choose(), but I would require the SQL you have so far to provide a more helpful usage example of the function.
Jan 25 '10 #2
mb60
37 New Member
Thank you sir
where I have to place that function in the database?
I don't know anything about SQL
Jan 25 '10 #3
NeoPa
32,573 Recognized Expert Moderator MVP
And I (still) no nothing about your SQL. Please reread my last post to find out what you need to do to get more help. To clarify further, see below :
To extract the SQL from a QueryDef (saved Access query) it is only necessary to view the query in SQL View. This shows the underlying SQL for the QueryDef and is text (See Access QueryDefs Mis-save Subquery SQL for problems with SubQueries). When a QueryDef is open (either in Design View or Datasheet View) it is possible to switch to the SQL View simply by selecting View \ SQL View from the menu.

From here it is simple to Copy & Paste it to wherever you need it.
Jan 25 '10 #4
mb60
37 New Member
sir
As you directed I extracted SQL and pasting here
Expand|Select|Wrap|Line Numbers
  1. SELECT questionbank.question, questionbank.ID, questionbank.[1], questionbank.[2], questionbank.[3], questionbank.[4], questionbank.answer, questionbank.[select]
  2. FROM questionbank
  3. WHERE (((questionbank.[select])=-1));
Jan 25 '10 #5
NeoPa
32,573 Recognized Expert Moderator MVP
Thank you.

The Choose() function would be something like line #9 :
Expand|Select|Wrap|Line Numbers
  1. SELECT [Question],
  2.        [ID],
  3.        [1],
  4.        [2],
  5.        [3],
  6.        [4],
  7.        [Answer],
  8.        [Select],
  9.        Choose([Answer],[1],[2],[3],[4]) AS AnswerText
  10.  
  11. FROM   [QuestionBank]
  12.  
  13. WHERE  [Select]
Jan 25 '10 #6
mb60
37 New Member
Thank you sir
successfully I got what I want that result
I salute for your interest in solving such problems
No words to express my happiness
(pl ignore the mistakes if any, in my english)
Jan 26 '10 #7
NeoPa
32,573 Recognized Expert Moderator MVP
Very pleased to hear it.

We do try to ignore language problems, but sometimes it's hard to understand. This thread was no problem though.
Jan 26 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5065
by: raiya | last post by:
hi, I'm a teacher and new ms access user. I'm intending to design an ms access db to post multiple choice questions each with 4 choices. I created 2 tables one for the questions and the other for the answers. The first has the fields: question_no - number question - text answer - memo --- gives the full solution The second has the fields: question_no - number answer_no - number answer - text t/f - text --- if this is the correct...
1
19316
by: carly | last post by:
hi, i've been solving these multiple choice questions, and i'd like to know if what i answered is right ot wrong......... just to double check :) I) Consider the code given below. class Base{} public class MyCast extends Base{ static boolean b1=false;
0
1177
by: Night Air | last post by:
I have problem with a website that collects user responses to multiple choice questions. The users choose and value from a Radio Button, then click on a Next button to go the next page. The problem occurs when users click on the Next button too quickly. For example, when you click a few times, in rapid succession, even thought the pages are not displayed between the first and the page you arrive at, the same multiple choice response...
1
6129
by: Brian Byrne | last post by:
Hi , Does anybody know where there is a good bank of C++ multiple choice questions covering all the essentials. I need to brush up on the basics and multiple choice is the ideal way !? Thanks, Brian
1
1930
by: Night Air | last post by:
I'm working with a website that presents a series of multiple choice questions to users. The problem at hand is that the pages with the questions take some time load and the users are under a time limit to answer the questions. Would you know if there is a way to "download" the question bitmaps to the user's PC to some type of cache before the timer starts for the user?
3
9059
mb60
by: mb60 | last post by:
hello I am working as teacher. Pl any one can help me in creating a template for multiple choice questions, and matching questions and selecting the answers in ms access? The format of qns as follows 1). xxxxxxxxxxxxxxxxxx 1) aaaaaaaaaaaa 2) bbbbbbbb 3) cccccccccccc 4) dddddddd 2) Match the following List - I List -II A) aaaaa I) bbbbb B) ccccc ...
3
7802
by: shashkun | last post by:
hii i wanted to insert questions, options and correct answer in the database(Multiple choice questions). I have around 8000 questions to be inserted. I tried with copying entire content from word into notepad and provided delimiters for questions and answers but the entire question appears in a single line(it is big problem when question size is big)in the data base which i dont want to be /// Could anyone of you help me out? Note: We can...
0
9591
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10057
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10002
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9869
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2816
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.