views:

37

answers:

1

Hi guys, i have to display Datetime in my gridview, the problem is that while i am inserting values to the database, for default date i am passing "1/1/1900", So when retrieving the data i found the value "01/01/1900 12:00:00 AM" in gridview. if the datetime is "01/01/1900 12:00:00 AM" i want it as a null value or the corresponding date, Can i check this in Store procedure? Pls help...

+3  A: 
SELECT
    CASE
        WHEN DateField = '01/01/1900 12:00:00 AM' THEN NULL
        ELSE DateField
    END AS DateField
FROM
   Wherever
Sean Bright