473,499 Members | 1,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Database Value Retrieval

I have the following sql statement, typically it would grab a specific
value but I also want to be able to grab all values within the
database. Can I use the same SQL statement? I thought I could just use
* and pull everything but that doesn't appear to work.

SELECT tblRacers.RacerID, tblRacers.strLName, tblRacers.strFName,
tblRacers.strAgeCat, tblRacers.strRaceCat FROM tblRacers WHERE
tblRacers.strAgeCat='" & strAgeCat & "' AND tblRacers.strRaceCat='" &
strRaceCat & "';

I thought if the value passed in for strAgeCat/strRaceCat was * it
would pull all but I guess that isn't the case. Any suggestions on how
to approach this?

Thanks!

Nov 19 '05 #1
1 999
Hello

I don't know what you are stored in strAgeCat but you can form your query
like this.

SELECT tblRacers.RacerID, tblRacers.strLName, tblRacers.strFName,
tblRacers.strAgeCat, tblRacers.strRaceCat FROM tblRacers WHERE
tblRacers.strAgeCat like '% " & strAgeCat & "%' AND tblRacers.strRaceCat
like '%" &
strRaceCat & "'%" ;

However this is not the proper solution but we can fetch all the records
from the database not setting the value of strAgeCat/strRaceCat. I mean in
the absense of the values the query we shall have tblRacers.strAgeCat like
'%%' and so will get all the records.

I think it may work for you.

regards,
Bhavesh Patel
"Sparky Arbuckle" wrote:
I have the following sql statement, typically it would grab a specific
value but I also want to be able to grab all values within the
database. Can I use the same SQL statement? I thought I could just use
* and pull everything but that doesn't appear to work.

SELECT tblRacers.RacerID, tblRacers.strLName, tblRacers.strFName,
tblRacers.strAgeCat, tblRacers.strRaceCat FROM tblRacers WHERE
tblRacers.strAgeCat='" & strAgeCat & "' AND tblRacers.strRaceCat='" &
strRaceCat & "';

I thought if the value passed in for strAgeCat/strRaceCat was * it
would pull all but I guess that isn't the case. Any suggestions on how
to approach this?

Thanks!

Nov 19 '05 #2

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

Similar topics

3
6259
by: Doug Baroter | last post by:
Hi, One of my clients has the following situation. They use Access DB for data update etc. some business functions while they also want to view the Access data quickly and more efficiently in...
49
3145
by: Relaxin | last post by:
It is just me or has MS created some of the worst ways to access and display data? You can use a DataSet, but if you want to sort or filter the data to must use a DataView which is created from...
11
17017
by: Rosco | last post by:
Does anyone have a good URL or info whre Oracle and Access are compared to one another in performance, security, cost etc. Before you jump on me I know Oracle is a Cadillac compared to Access the...
29
5859
by: A.P. Hofstede | last post by:
Could someone tell me where MS-Access (current and 97?) fit(s) on the RDBMS - ORDBMS - ODBMS spectrum? I gather it's relational, but how does it size up against/follow SQL2/3/4 definitions and how...
3
5222
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from...
6
3834
by: Bob Alston | last post by:
I am looking for others who have built systems to scan documents, index them and then make them accessible from an Access database. My environment is a nonprofit with about 20-25 case workers who...
22
5766
by: teejayem | last post by:
Hi, I am new to programming with databases and was wanting some help. Is there any way to password protect an access database and access sent sql commands to it via vb.net code? Any help...
12
3909
by: grace | last post by:
i am wondering why my database retrieval becomes too slow...we set up a new server (ubuntu, breezy badger) machine where we transferred all our files from the old server.. Our new server uses Asus...
1
1718
by: bg_ie | last post by:
Hi there, My company uses a very buggy and poorly designed msaccess database which we use to store information from the components we use, to test results. The database has been added to bit by...
0
7007
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...
0
7174
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,...
0
7220
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...
0
5470
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,...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
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...

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.