Group:  Microsoft Access ยป microsoft.public.access.queries
Thread: QUERY QUESTION

Geek News

QUERY QUESTION
COMPSCI610 12/30/2008 6:04:01 PM
WHAT DO I NEED TO DO WITH THIS QUERY TO GET IT TO TERMINATE ON A NULL STRING
OR 0?

SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
FROM STORPOGTRASH
WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));
Re: QUERY QUESTION
"BruceM" <bamoob[ at ]yawhodotcalm.not> 12/30/2008 6:32:52 PM
First, release the cap lock key. Use of all caps is taken as shouting, and
if regarded as rude.

Second, explain what you mean by "terminate", and where the 0 or null string
will occur. BTW, do you mean an empty string, a null value, or what
exactly?

"COMPSCI610" <COMPSCI610[ at ]discussions.microsoft.com> wrote in message
news:E9582D1F-B0BC-4376-8BF9-D000FC6DC1C7[ at ]microsoft.com...
[Quoted Text]
> WHAT DO I NEED TO DO WITH THIS QUERY TO GET IT TO TERMINATE ON A NULL
> STRING
> OR 0?
>
> SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
> FROM STORPOGTRASH
> WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));

Re: QUERY QUESTION
"Bob Barrows" <reb01501[ at ]NOyahoo.SPAMcom> 12/30/2008 6:33:18 PM
COMPSCI610 wrote:
[Quoted Text]
> WHAT DO I NEED TO DO WITH THIS QUERY TO GET IT TO TERMINATE ON A NULL
> STRING OR 0?
>
> SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
> FROM STORPOGTRASH
> WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));

Your caps lock key is stuck. Please unstick it.

What do you mean by "terminate"? Stop without returning any records?
Raise an error?
Do you understand what queries do? They assemble a set of records that
satisfy given criteria and return them to the caller. It's not a process
that "terminates" until the set of records is returned to the caller.



--
HTH,
Bob Barrows


Re: QUERY QUESTION
"Bob Barrows" <reb01501[ at ]NOyahoo.SPAMcom> 12/30/2008 6:37:56 PM
COMPSCI610 wrote:
[Quoted Text]
> WHAT DO I NEED TO DO WITH THIS QUERY TO GET IT TO TERMINATE ON A NULL
> STRING OR 0?
>
> SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
> FROM STORPOGTRASH
> WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));

If the idea is that you only want to return records if none of the
fields contain a null in any of the records, then you can do something
like this:

SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
FROM STORPOGTRASH
WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));
AND NOT EXISTS (
SELECT * FROM STORPOGTRASH WHERE [SPOG#] is Null or [POGSTR#] is Null)



--
HTH,
Bob Barrows


Re: QUERY QUESTION
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 12/30/2008 6:55:28 PM
On Tue, 30 Dec 2008 10:04:01 -0800, COMPSCI610
<COMPSCI610[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>WHAT DO I NEED TO DO WITH THIS QUERY TO GET IT TO TERMINATE ON A NULL STRING
>OR 0?
>
>SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
>FROM STORPOGTRASH
>WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));

Please lay off the CAPS LOCK. It's hard to read and looks like you're
SHOUTING.

That said... what do you mean by "terminate"? A query isn't procedural, and
doesn't "run until it terminates" - it returns a recordset which might or
might not contain any records.

What's the context, and what do you want to happen?
--

John W. Vinson [MVP]
Re: QUERY QUESTION
"Bob Barrows" <reb01501[ at ]NOyahoo.SPAMcom> 12/30/2008 7:26:28 PM
Bob Barrows wrote:
[Quoted Text]
> COMPSCI610 wrote:
>> WHAT DO I NEED TO DO WITH THIS QUERY TO GET IT TO TERMINATE ON A NULL
>> STRING OR 0?
>>
>> SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
>> FROM STORPOGTRASH
>> WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));
>
> If the idea is that you only want to return records if none of the
> fields contain a null in any of the records, then you can do something
> like this:
>
> SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
> FROM STORPOGTRASH
> WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));
> AND NOT EXISTS (
> SELECT * FROM STORPOGTRASH WHERE [SPOG#] is Null or [POGSTR#] is
> Null)
>
errr - you should remove that semicolon ...
Corrected:
SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
FROM STORPOGTRASH
WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]))
AND NOT EXISTS (
SELECT * FROM STORPOGTRASH WHERE [SPOG#] is Null or [POGSTR#] is Null)

--
HTH,
Bob Barrows


Re: QUERY QUESTION
COMPSCI610 12/30/2008 10:10:03 PM
If 0 is entered as the planogram number or if the input box is left blank, I
would like the query to stop running. I have this set up in a Macro that
repeats over and over. This is why I need it to stop once invalid data is
inputed.

"BruceM" wrote:

[Quoted Text]
> First, release the cap lock key. Use of all caps is taken as shouting, and
> if regarded as rude.
>
> Second, explain what you mean by "terminate", and where the 0 or null string
> will occur. BTW, do you mean an empty string, a null value, or what
> exactly?
>
> "COMPSCI610" <COMPSCI610[ at ]discussions.microsoft.com> wrote in message
> news:E9582D1F-B0BC-4376-8BF9-D000FC6DC1C7[ at ]microsoft.com...
> > WHAT DO I NEED TO DO WITH THIS QUERY TO GET IT TO TERMINATE ON A NULL
> > STRING
> > OR 0?
> >
> > SELECT STORPOGTRASH.[SPOG#], STORPOGTRASH.[POGSTR#]
> > FROM STORPOGTRASH
> > WHERE (((STORPOGTRASH.[SPOG#])=[PLEASE ENTER A PLANOGRAM NUMBER]));
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net