By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,835 Members | 1,959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,835 IT Pros & Developers. It's quick & easy.

comparing field data from previous field in loop with null values

P: n/a
Im comparing values in a field while doing a loop
if sAct<>myData(5,i) then
At the end of the loop I make the value of sAct equal the current
myData

This will work when comparing other fields withing my recordset (so I
know the statement works) but it will not work for the field I want to
compare. The only difference with this field is that it has null
values. Could this be the problem? if so, how do I deal with nulls?

Feb 14 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
I should say my code works but just completely ignors null values. I
need it to treat nulls like anything else. My code will catch when it
changes from A11 to B17...I also need for it to catch a change from G38
to null

sAct<>myData(5,i)

What do I need to change?

Feb 14 '06 #2

P: n/a
ab*******@hotmail.com wrote:
Im comparing values in a field while doing a loop
if sAct<>myData(5,i) then
At the end of the loop I make the value of sAct equal the current
myData

This will work when comparing other fields withing my recordset (so I
know the statement works) but it will not work for the field I want to
compare. The only difference with this field is that it has null
values. Could this be the problem? if so, how do I deal with nulls?


if sAct<>myData(5,i) & "" then
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Feb 14 '06 #3

P: n/a
if sAct<>myData(5,i) & "" then

This doesn't seem to work...even so the statement wouldn't really work
here anyway.

If for example sAct is null and myData(5,i) has a value, this statement
would not pick up on the change. I need this trigger to go off if there
is any change between the two objects.

Feb 14 '06 #4

P: n/a
ab*******@hotmail.com wrote:
if sAct<>myData(5,i) & "" then

This doesn't seem to work...even so the statement wouldn't really work
here anyway.
Then, I'm sorry, but you're going to have to do a better job of describing
what "doesn't work" means. What I posted was a stab based on what I guessed
you meant.
If for example sAct is null and myData(5,i) has a value, this


Oh come on!

if sAct & "" <>myData(5,i) & "" then


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Feb 14 '06 #5

P: n/a
wrote on 14 feb 2006 in microsoft.public.inetserver.asp.general:
if sAct<>myData(5,i) & "" then

This doesn't seem to work...even so the statement wouldn't really work
here anyway.

If for example sAct is null and myData(5,i) has a value, this statement
would not pick up on the change. I need this trigger to go off if there
is any change between the two objects.


if (sAct & "") <> (myData(5,i) & "") then

[This will see a null and an emplty string as the same.]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 14 '06 #6

P: n/a
Thank you everyone...and thank you Evertjan

Feb 15 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.