Hey, could someone remind me how to do this?
I want to select a client from TABLE1 where their sub_id is equal to 'O'
or 1?
For some reason I forgot how to do this in one statement.
Thanks,
Andrew J Durstewitz http://www.devbuilder.org
DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB.NET,PHP,Java,and SQL Support, all in one place. 6 1763
On 15 Sep 2003 15:52:14 GMT, Andrew J Durstewitz
<ad******@devbuilder.org> wrote: Hey, could someone remind me how to do this?
I want to select a client from TABLE1 where their sub_id is equal to 'O' or 1?
For some reason I forgot how to do this in one statement.
select xxx from Table1 Where sub_id = 0 or sub_id = 1
or
select xxx from Table1 where sub_id in (0, 1)
What datatype is sub_id? How can it possibly be an 'O' or a 1?
Anyway, you can use an OR clause, like
WHERE sub_id=0 OR sub_id=1
Or you could use an IN list, like
WHERE sub_id IN ('O', 'something')
"Andrew J Durstewitz" <ad******@devbuilder.org> wrote in message
news:3f***********************@news.frii.net... Hey, could someone remind me how to do this?
I want to select a client from TABLE1 where their sub_id is equal to 'O' or 1?
For some reason I forgot how to do this in one statement.
Thanks, Andrew J Durstewitz http://www.devbuilder.org
DEVBuilder.org, http://www.DEVBuilder.org ASP,ASP.NET,VB.NET,PHP,Java,and SQL Support, all in one place.
I understand the OR statement but I need to it to be a match of 2 or 3
items.
client MUST = strClient
sub_id MUST = 'O' or 1
See what I mean?
Something like...
Select * from TABLE1 where client = strClient and (sub_id = 'O' or
sub_id = 1)
I think that's the wrong syntax, that is why I am having a problem.
thx,
Andrew
DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB.NET,PHP,Java,and SQL Support, all in one place.
I don't think you said that in your first post.
Did you try the statement you posted? It looks like what you want except
the 1 should be in quotes (as I assume sub_id is a char or varchar)
"SELECT client, sub_id FROM client WHERE (client='" & strClient & "') AND
(sub_id='O' OR sub_id='1')"
I added the paranthesis for clarity.
"Andrew J Durstewitz" <ad******@yahoo.com> wrote in message
news:3f***********************@news.frii.net... I understand the OR statement but I need to it to be a match of 2 or 3 items.
client MUST = strClient sub_id MUST = 'O' or 1
See what I mean?
Something like...
Select * from TABLE1 where client = strClient and (sub_id = 'O' or sub_id = 1)
I think that's the wrong syntax, that is why I am having a problem.
thx, Andrew
DEVBuilder.org, http://www.DEVBuilder.org ASP,ASP.NET,VB.NET,PHP,Java,and SQL Support, all in one place.
Why do you think it is the wrong syntax? Show some data and desired
results.
Is sub_id a text field or numeric? You are trying to select either text or
numeric from a field which is it?
Select * from TABLE1 where client = strClient and (sub_id = 0 or
sub_id = 1)
or
Select * from TABLE1 where client = strClient and (sub_id = 'O' or
sub_id = '1')
Mike
"Andrew J Durstewitz" <ad******@yahoo.com> wrote in message
news:3f***********************@news.frii.net... I understand the OR statement but I need to it to be a match of 2 or 3 items.
client MUST = strClient sub_id MUST = 'O' or 1
See what I mean?
Something like...
Select * from TABLE1 where client = strClient and (sub_id = 'O' or sub_id = 1)
I think that's the wrong syntax, that is why I am having a problem.
thx, Andrew
DEVBuilder.org, http://www.DEVBuilder.org ASP,ASP.NET,VB.NET,PHP,Java,and SQL Support, all in one place.
Thanks guys, it's working now. Just had some syntax errors on my side
it looks.
Thank you,
Andrew
DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB.NET,PHP,Java,and SQL Support, all in one place. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: mike420 |
last post by:
I think everyone who used Python will agree that its syntax is
the best thing going for it. It is very readable and easy
for everyone to learn. But, Python does not a have very good
macro...
|
by: John Marshall |
last post by:
How about the following, which I am almost positive
has not been suggested:
-----
class Klass:
def __init__(self, name):
self.name = name
deco meth0:
staticmethod
def meth0(x):
|
by: Petr Prikryl |
last post by:
Hi,
Summary: In my opinion, the C-like prefix
increment and decrement operators (++i and --i)
should be marked as "syntax error".
Current situation: try... (Python 2.4 (#60, ...))
>>> i =...
|
by: Spencer |
last post by:
Field Names: NOs Code Code1a UniqueID
61 10 888 10
62 10 888 11
63 ...
|
by: vulcaned |
last post by:
Hi All,
Need help with the right statement for the following situation.
In Access97 I have a Form(frmComplaintUpdate) which has a Tab
Control(called TabCtl987) with several tabs(first tab we'll...
| |
by: C# Learner |
last post by:
Why is C syntax so uneasy on the eye?
In its day, was it _really_ designed by snobby programmers to scare away
potential "n00bs"? If so, and after 50+ years of programming research,
why are...
|
by: danu |
last post by:
I have a structure :
typedef struct{
char magicNum;
int width;
int height;
int maxGrey;
int pixels;
} ImageT;
|
by: braver |
last post by:
Greetings -- as a long time user of both Python and Ruby interpreters,
I got used to the latter's syntax-coloring gem, wirble, which
colorizes Ruby syntax on the fly. Is there anything similar for...
|
by: bearophileHUGS |
last post by:
I have just re-read the list of changes in Python 2.6, it's huge,
there are tons of changes and improvements, I'm really impressed:
http://docs.python.org/dev/whatsnew/2.6.html
I'll need many...
|
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,...
|
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: 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,...
|
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: 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...
|
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...
|
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,...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |