Solved

Undefined function 'IsDBNull' in expression

Posted on 2004-03-24
3
808 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 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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