Home Forums SQL Server 2008 T-SQL (SS2K8) DateDiff help to verify my code is correct or not? RE: DateDiff help to verify my code is correct or not?

  • By the way, you still haven't told us how you want to handle situations where one or both of the dates are null. If date1 is null and date2 is not null, date1 is not null and date2 is null, both date1 and date2 are null. We need this information to provide a complete answer.

    What would really help, is the DDL (CREATE TABLE statement(s)) for the table(s) involved, sample data for the table(s) as a series of INSERT INTO statements, expected results based on the sample data, and the code you have written so far to solve your problem.

    If you need help with all this, take the time to read the first article I reference below in my signature block regarding asking for help. It will walk you through what you need to post and how to do it.