Link to home
Start Free TrialLog in
Avatar of Graeme McGilvray
Graeme McGilvrayFlag 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?
Avatar of Manuel Marienne-Duchêne
Manuel Marienne-Duchêne
Flag of France image

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

Open in new window


Miss )
Avatar of Graeme McGilvray

ASKER

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

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
The actual Code that is having an issue is:

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

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

Open in new window

Avatar of Ryan Chong
x="all"
response.write(IsNumeric(x))
this returned as false to me.
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/?
Request.QueryString("event")="all"
this should be an invalid statement and your page would have generated an error on screen.
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.
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?
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?
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...
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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Strange that it is doing this, but work around works