473,402 Members | 2,055 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,402 software developers and data experts.

Filter SQL syntax for multiple parameters, please help!

Hi everyone,

Is it possible to write an SQL to filter for Field1 = A AND (Field2 OR Field 3) = B?

eg. Select * from TableName where Field1 Like A AND (Field2 Like B OR Field3 Like B)

If this is possible, pleeeease help me with the syntax!

Thanks!
Oct 18 '07 #1
3 3690
Rabbit
12,516 Expert Mod 8TB
Numbers:
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM Table1
  3. WHERE Field1 = 1 AND (Field2 = 2 OR Field3 = 3);
  4.  
Strings:
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM Table1
  3. WHERE Field1 = 'A' AND (Field2 = 'B' OR Field3 = 'C');
  4.  
Dates:
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM Table1
  3. WHERE Field1 = #1/1/2007# AND (Field2 = #2/2/2007# OR Field3 = #3/3/2007#);
  4.  
Oct 18 '07 #2
Thanks Rabbit! much appreciated.
Oct 18 '07 #3
Rabbit
12,516 Expert Mod 8TB
Thanks Rabbit! much appreciated.
Not a problem, good luck.
Oct 18 '07 #4

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

Similar topics

2
by: nati | last post by:
How can i read the light filter properties? I have a divide with id="pic". I have assigned a light filter - pic.style.filter='light()'; I have assigned an ambient and two cones to the filter and...
9
by: heruti | last post by:
Hi all... I've been stumped by this for days. Bit of ASP code: (IIS) Set LocalConn = CreateObject("ADODB.Connection") LocalConn.CursorLocation = adUseClient LocalConn.CommandTimeout = 0...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
1
by: Gabor | last post by:
In my app I'm using a dll, wich includes an installer class. The install sub call the SetMSDEForApp sub wich two parameters: Public Overrides Sub Install(ByVal stateSaver As...
1
by: lorirobn | last post by:
Hi, I have a report that works just fine. Now I would like to add the capability to choose selection criteria to limit what is displayed. I created several reports that do this, but they used...
1
by: stjulian | last post by:
I have a stored procedure which returns 2 tables and 1 output value. I want the first table to be assigned to rs1 and the second to rs2. However when I run this, I get the following error as I...
2
by: amir | last post by:
How can I filter my database in Multiple way, I mean that I wana to filter st. like this: sm* *th* *er Please Help me on this matter Amir
20
by: W Karas | last post by:
Would the fear factor for concepts be slightly reduced if, instead of: concept C<typename T> { typename T::S; int T::mem(); int nonmem(); };
3
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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
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...

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.