Solved

Undefined function 'IsDBNull' in expression

Posted on 2004-03-24
3
810 Views
Last Modified: 2006-11-17
I have a sql statement that pulls data from ms access db if the date in the table is null or greater or equals to today's date.
I am converting asp to asp.net. In my WHERE clause I had
WHERE  (isNull(endDate)  OR endDate >= Date())

after converting to .net I got

WHERE (IsDBNull(endDate) OT endDate >= DateTime.Now)

But now I'm getting an error Undefined function 'IsDBNull' in expression.

I mported System.DBNull.
What am I doing wrong?
0
Comment
Question by:YZlat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Expert Comment

by:msdixon
ID: 10669195
if this is from a sql statement change it back to isnull.

if this is vb code you can use
endDate = DBNull.Value

to see if a value is null
0
 
LVL 35

Author Comment

by:YZlat
ID: 10669314
where do I put this line endDate = DBNull.Value?
in my sql statement?


I have "SELECT * FROM Table1 WHERE (IsDBNull(endDate) OT endDate >= DateTime.Now)"
0
 
LVL 7

Accepted Solution

by:
dante469 earned 50 total points
ID: 10669393
The WHERE clause will run on the SQL server and must use SQL syntax...

Depending on your version of SQL that may change however this will work on SQL 6.5 or above..

           WHERE  ((endDate Is Null)  OR endDate >= GetDate() )

Have Fun,
Dante
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question