We help IT Professionals succeed at work.

Handleing NULLs when performing a comparison between two datetime fields

370 Views
Last Modified: 2012-02-09
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?
Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.