Avatar of Graeme McGilvray
Graeme McGilvray
Flag for Australia asked on

Defining a Number v Text

Hello all and thanks in advance for your assistance

I am having issues with what I thought was how to tell the difference between a number and text by using IsNumeric, however I am finding that for example
If IsNumeric(Request.QueryString("all") Then

Open in new window

is processing and giving an output...

Is there something I am missing?
ASP

Avatar of undefined
Last Comment
Graeme McGilvray

8/22/2022 - Mon
Manuel Marienne-Duchêne

If IsNumeric(Request.QueryString("all") ) Then

Open in new window


Miss )
Graeme McGilvray

ASKER
Sorry Manuel, yes I did miss it in this Question... however it is in the code.. sorry again
SOLUTION
Manuel Marienne-Duchêne

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Graeme McGilvray

ASKER
Thanks for that Manuel

The issue im getting is...

x="all"
response.write(IsNumeric(x))

If IsNumeric(x) Then

This is coming true and then proceeding in the IF statement
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Graeme McGilvray

ASKER
The actual Code that is having an issue is:

Request.QueryString("event")="all"

If IsNumeric(Request.QueryString("event")) Then

Open in new window

Ryan Chong

x="all"
response.write(IsNumeric(x))
this returned as false to me.
Graeme McGilvray

ASKER
Hi Ryan, in post 42071145, I am displaying the code that is having an issue... :(

I have just thought of something... Its showing up on a page that doesnt require is... eg http://dev.gptouring.com.au/?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Ryan Chong

Request.QueryString("event")="all"
this should be an invalid statement and your page would have generated an error on screen.
Ryan Chong

Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'event_code=code_short AND event_start>Now() AND code_live=TRUE AND event_live=TRUE AND event_ID='. 

Open in new window


as what i guess... from this error, it mentioned that Request.QueryString("event") is missing which causing error in your SQL statement.

so you need to have a better error handling in case Request.QueryString("event") is not found.
Graeme McGilvray

ASKER
I think I have figured it out...

If IsNumeric(Request.QueryString("event")) AND NOT (Request.QueryString="" OR Request.QueryString="?") Then

Open in new window


doesnt error... is that because it would see "" OR "?" as IsNumeric?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Ryan Chong

If IsNumeric(Request.QueryString("event")) AND NOT (Request.QueryString="" OR Request.QueryString="?") Then
nope... what if you have this?

http://dev.gptouring.com.au/?x
http://dev.gptouring.com.au/?bla=

Open in new window

etc?
Graeme McGilvray

ASKER
I am getting errors on:
http://dev.gptouring.com.au/?category=70
Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'event_code=code_short AND event_start>Now() AND code_live=TRUE AND event_live=TRUE AND event_ID='.

Open in new window


Why would this happen?

Im not even asking for Request.QueryString("event") on this page...
Ryan Chong

Im not even asking for Request.QueryString("event") on this page... 

Open in new window

try post and examine the codes around:

AND event_ID=

Open in new window


and you should fine that something is missing there
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Graeme McGilvray

ASKER
Yeah I a not sure why...

The homepage of the website is first in the hierarchy order and the Query that it is erroring on (the line we have seen
'event=') is after it.

just strange!

seems to be not erroring now, been through alot of pages and all good
Graeme McGilvray

ASKER
Strange that it is doing this, but work around works
Graeme McGilvray

ASKER
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck