Link to home
Start Free TrialLog in
Avatar of PratikShah111
PratikShah111

asked on

need help with null values in datediff sql query

in sql query while doing datediff I want to take into consideration null values too

this is what i have

    SUM(CASE WHEN DATEDIFF(day, LoadDate, StartDate) BETWEEN 0 AND 2
        THEN 1 ELSE 0 END) AS 'Testfield'

In the above scenario start date can either be some date or null. If its null I want to make it today's date.  can we do that.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

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