Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > comparing field data from previous field in loop with null values

Reply
Thread Tools

comparing field data from previous field in loop with null values

 
 
abbylee26@hotmail.com
Guest
Posts: n/a
 
      02-14-2006
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?

 
Reply With Quote
 
 
 
 
abbylee26@hotmail.com
Guest
Posts: n/a
 
      02-14-2006
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?

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      02-14-2006
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.


 
Reply With Quote
 
abbylee26@hotmail.com
Guest
Posts: n/a
 
      02-14-2006
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.

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-14-2006
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)
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      02-14-2006
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.


 
Reply With Quote
 
abbylee26@hotmail.com
Guest
Posts: n/a
 
      02-15-2006
Thank you everyone...and thank you Evertjan

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
form remembers previous text-field values John Devlon ASP .Net 6 11-01-2007 04:36 PM
comparing values of field and inserting data based on comparision to third filed Tradeorganizer ASP General 3 02-07-2007 05:13 AM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
Comparing values in 2 textfiles and returning the missing values Jorgen Gustafsson Perl 4 12-12-2003 09:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57