Link to home
Start Free TrialLog in
Avatar of ITMikeK
ITMikeKFlag for United States of America

asked on

Handleing NULLs when performing a comparison between two datetime fields

I have a GridView being populated using a SPROC in SQL SERVER 2008 in an ASP.NET app.
In the grid two fields are being compared.
PromisedDate  and  ShippedDate

both are datetime

If  ShippedDate>PromisedDate   the color of the background of that record is changed to red.

Up to this point the PromisedDate has not been used, and there are lots of 'NULL' records.
How can I handle the NULLs in this situation of a datetime?
SOLUTION
Avatar of askanilkris
askanilkris
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITMikeK

ASKER

I have changed the default on that field in the table, then changed all the null values that were present.
This will also prevent future squabbles when dealing with that field in the future.