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?

  • Hi Sean,

    When you say-

    "

    I haven't seen all the other threads but from what you posted I can't figure out why you are using DATEDIFF at all. It doesn't meet your requirements and it will make your query nonSARGable"

    Can you please help me understand why it does not meet my requirement?

    Also Why and under what scenarios / situtations DateDiff function needs to be used and need not be used?

    The solution you and Lynnhave provided that I already had beven before I joined this site, but using Predicates comparison for dates is not allowed in my team I have been asked to use DateDiff hence would be much obliged if you can justiy your reason and help me learn please so that I can convince my manager 🙂

    Kind Regards

    Dhananjay