Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null or something problem

Status
Not open for further replies.

ebarratt

Programmer
Apr 10, 2002
53
US
Hey all,

I'm doing a left outer join with sql. Sometimes the fields that I'm using to join on do not find a matching record. For instance.

Select tb1field, tbl2field from tbl1 Left outer join tbl2 on tb1field = tb2field.

Most of the records join together, however sometimes there are no matching records in tbl2 to join with. I still need to assign the value from tbl2field in the records that did not join.

like vbvariable = tbl2field. What values are entered into tbl2field when the record was not joined? And how do I do a conditional statement on that value. Something like
IF tbl1field1 = 10 AND tbl2field = ????


ANY HELP WOULD BE GREAT!!! Thanks all Errol Barratt
work: 856-810-5712
home: 856-697-1593
*** If there is a possibility, I'm sure all the smart ones out there will enlighten me 8p
 
Hi there ...
it returns null

So you try this :
IF tbl1field1 = 10 AND tbl2field = Null

hope it works.
E.T.
 
figured it out.... it does return null but you can't use =null you have to use Isnull(rs("fieldname")) to get the value.


Thanks for your information though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top