[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Undefined function 'IsDBNull' in expression

Posted on 2004-03-24
3
Medium Priority
?
826 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
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 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 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