|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
String comparisons?
Hello,
I have two tables in Access linked to corresponding AS400 tables. I do two queries where I want to compare numerous fields from each table. Lets call them rst and rst1. The question is how to validate if one of the fields is NULL. Assume rst![field] = "H" and rst1![field] = NULL. Try validation: If rst![field] <> rst1![field] then 'do something. This should fail since H <> Null. But it doesn't fail when it should. If I had "H" <> " " it suceeds, but I don't know of a way to manupulate the data in the linked table or through code to represent NULL as " ". Any ideas? Ric |
|
#2
|
||||
|
||||
|
probably the best thing I could tell you to do is to check for isnull first
Code:
IF isnull(rst1.field) or inull(rst2.field) then
blnValid = false
elseif rst1.field <> rst2.field then
blnValid = false
else
blnvalid = true
end if
if blnvalid = true then
'process information
end if
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > String comparisons? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|