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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking for non null values in a database.

Status
Not open for further replies.

Jovix

Programmer
Dec 3, 2003
39
US
I didn't know how to describe the problem on the subject line but here it is. I have a program that looks at a database. One of my tables has four date fields and depending on the data entry criteria, only one of those date fields will be populated. I need a piece of code that will check all for fields and only return the one that is not null. I was thinking of using and IF Then statement. But I'm not sure what to do.

thanks in advance
Jovix
 
if you are using SQL Server as your database then look up

CASE SQL Syntax

Hope I've been helpful,
Wayne Francis

If you want to get the best response to a question, please check out FAQ222-2244 first
 
Using the "If Then", replace "MyRecordset.Field" with your info.

If Not IsNull MyRecordset.Field then
msgbox "Field contains data"
Else
msgbox "Field is Null"
End if


Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top