Solved

Undefined function 'IsDBNull' in expression

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

810 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