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

i need help writing a query ...

Hi,

I am looking to write a query with multiple factors and do not know
the best way to do it.
I want use Event Type, Status, and Region as my queries variables.
By
default I want show "all", but then be able to use drop downs to
filter with.
Can anyone please give me an idea on the best way to do this? If
this
does not seem to make sense, please let me know.
Kind Regards,
Ray
Dec 14 '07 #1
1 1327
On Dec 14, 9:17 am, bcap <r...@patriots.comwrote:
Hi,

I am looking to write a query with multiple factors and do not know
the best way to do it.

I want use Event Type, Status, and Region as my queries variables.
By
default I want show "all", but then be able to use drop downs to
filter with.

Can anyone please give me an idea on the best way to do this? If
this
does not seem to make sense, please let me know.

Kind Regards,
Ray
In the combo box, use a union query to add '<All>' to your result set
with the ID set to 0. Eg.

SELECT idPaymentType, txtPaymentType
FROM tblPaymentTypes
UNION
SELECT 0,"<All>"
From tblPaymentTypes;

Typically, in the where clause of your SQL, then use this syntax:

WHERE (idPaymentType = <the combo valueor 0=<the combo value>)

This causes the WHERE clause to be ignored if all is selected. You can
do this with several combo boxes to have the desired effect.

Hope this helps!
Dec 14 '07 #2

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

Similar topics

2
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...
0
by: JC | last post by:
I am using Mysql version: 4.0.18-max-log and trying to populate a database from a text file using source option from inside the mysql environment. The population run OK but when creating the...
6
by: Martijn van Oosterhout | last post by:
I've had some fun in the past where I've had to grant a lot of tables and other similar system commands. Unfortunatly, you can't use queries to fill in fields for you. Anyway, I've implemented a...
6
by: ti33m | last post by:
Hi All, I'd like to include a datasheet on my user interface but since I'm starting to run tight on space, I'd like to have a vertically-oriented datasheet (column 1 has labels, column 2 has...
3
by: pw | last post by:
Hi, I am having a mental block trying to figure out how to code this. Two tables: "tblQuestions" (fields = quesnum, questype, question) "tblAnswers" (fields = clientnum, quesnum, questype,...
2
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 ...
1
by: Paul Mendez | last post by:
I really need your assistance. I tried what you gave me and it did not work and I am thinking that the formatting that showed up when u saw my posting might have confused you. So I made sure to...
20
by: Tony | last post by:
I have a situation where I want to send data, but I have no need for a response. It seems to me that XMLHTTPRequest is the best way to send the data, but I don't need any response back from the...
9
by: Blarneystone | last post by:
Hi, I am using VB.NET and trying to pull data from two different tables in the database. I am using what I think is standard code. But the data I am pulling is like the following: Table1...
3
by: Michael R | last post by:
Hi all. I'm writing a report that utilizes a query called qryRecords SELECT * FROM tblRecordsORG1; however, there is tblRecordsORG1, tblRecordsORG2, etc. qryRecords should be based on...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...

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.