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

correct syntax for multiple sql query

hello again people...

Access2000, IIS6, win XP pro

I have a form where users can enter search criteria for various products.

now, if this form has 2 fields, colour and size (it wil have more but I'm
assuming the the principle for two fields will be the same for ten fields)

what would be the correct syntax for performing a query where the user
didn't enter a criteria for both fields?

the search string would be

strSQL = "SELECT * FROM products where colour = " & "'" &
request.form("searchstrcolour") & "'" & "AND size =" & "'"
request.form("searchstrsize") & "'" & " ORDER by price"

so if the user selects blue and large, thats fine

but what if the user only selected say blue and didn't bother with the size?

is there a wild card that I could use?

many thanks


Jul 19 '05 #1
0 1394

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

Similar topics

5
by: Dynamo | last post by:
Hello again ;-) What is the correct syntax to use when inserting a value into a table that contains a variable name with spaces. This works $query = "INSERT INTO Catalogue (Author) VALUES...
2
by: Matthew | last post by:
Hey , I have built a query which takes values from unbounded fields on a form, and it all works except for one thing. I have a few fields in my query that are dates. I also have a start and...
9
by: Mike Bridge | last post by:
I am using MS Access 2003, and I typed in a query in SQL view which was working fine. Now when I open it, it gives me the error "Join expression not supported". Apparently, Access "fixed" it for...
2
by: mick.smith1 | last post by:
I have written a short function to pass different criteria to a query. When I use the Like operator the string is inerpreted with single quotes i.e QueryCriteria = "Like '" & "camera*" & "'" is...
1
by: gatorfalcon | last post by:
I'm using mysqli_multi_query to run multiple queries concatenated with a semicolon that I set using the HEREDOC format. What's weird is that this works fine on my development system on my laptop...
6
by: DBDriver | last post by:
I have an Access 97 database on WinXP with a linked Excel table of about 100,000 rows. I'm trying to construct a query that will give me an editable datasheet showing records where data in a pair...
8
by: banderson | last post by:
Hello, I have a combo box in which I want to display multiple fields by concatenating the fields together. If one of those concatenated fields is Null, then the combo box does not show anything. To...
0
by: Zettai | last post by:
Hi All, I am trying to query a mysql database using the 'LIKE' keyword within my query based on what the user has input. It works if I pass the string, however I am having trouble getting it to...
4
by: LongWei | last post by:
Hi All, I have a select list in my HTML page as follows <select name="category" size="3" multiple="multiple" id="category"> <option value="Family">Family</option> <option...
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
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
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
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.