473,416 Members | 1,543 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

comparing field data from previous field in loop with null values

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
6 1873
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
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
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
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
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
Thank you everyone...and thank you Evertjan

Feb 15 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: - Steve - | last post by:
The following line of vb.net code works fine: if(strAnswer.toUpper() = strUserAnswer.toUpper()) However in an ASP.net page I'm told Object reference not set to an instance of an object ...
0
by: richardkreidl | last post by:
I have the following hash script that I use to compare two text files. 'Class Public Class FileComparison Public Class FileComparisonException Public Enum ExceptionType U 'Unknown A 'Add...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
35
by: dtschoepe | last post by:
Greetings. I am working on an assignment and can't seem to get the right concept for something I'm attempting to do with enum data types. I have defined the following in my code: enum color...
7
by: turtle | last post by:
I want to find out the max value of a field on a report if the field is not hidden. I have formatting on the report and if the field doesn't meet a certain criteria then it is hidden. I want to...
25
by: J Caesar | last post by:
In C you can compare two pointers, p<q, as long as they come from the same array or the same malloc()ated block. Otherwise you can't. What I'd like to do is write a function int comparable(void...
4
by: gillianbrooks91 | last post by:
Forgive me for asking this question, I've trawled through nearly every available post on this subject that I can find for a few weeks now but nothing quite points me in the right direction. I'm...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.