Forums

ASP

This topic is locked

IF Then statement help

Posted 14 Sep 2006 02:33:30
1
has voted
14 Sep 2006 02:33:30 lou castro posted:
I noticed that when I use a <> (Not Equal) in my if then statements, then it runs successfully. However, if I use an = , then it fails.. Can you use = and im just coding wrong? or should you always use <>.

For example
<% IF rsRecordset.field.value=0 then bla bla bla

This Fails

But if I use
<% IF rsRecordset.field.value<>1 then bla bla bla

Then this works!!!

Any ideas?

Edited by - lkcastro on 14 Sep 2006 02:33:57

Replies

Replied 17 Sep 2006 18:46:15
17 Sep 2006 18:46:15 Wim Conix replied:
Lou,

Most probably the value is just not equal to 0, but e.g. 'No' or something...
Check the exact value in your database and use this in your IF...THEN...
Should work.
Don't forget to use 'No' (quotes !) if your field is not numeric.

Hope this helps,

Wim

Wim Conix
www.image-belle.com

Reply to this topic