• Thanks Guys for your help, this one worked (SELECT 1 / NULLIF( ISNULL(@thirddatediff,1) - ISNULL(@seconddatediff,1), 0);)