Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3370 Division by zero in check 20 #3371

Merged

Conversation

Montro1981
Copy link
Contributor

Fix for #3370: Division by zero bug if pass 1 and 2 are to close to each other

In check 20 updated the DATEDIFF code with a small piece of code to replace the 0 (zero) with a 1

ISNULL(NULLIF( ..., 0), 1)

Basically this will NULL the DATEDIFF result if this is a 0 (zero) and then set it to 1 if it is NULL

This leaves the function of this piece of code as it was in all other cases other than the scenario reported in issue #3370

Copy link
Member

@BrentOzar BrentOzar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request! I agree with the solution. Looks good, merging into the dev branch, will be in the next release with credit to you in the release notes.

@BrentOzar BrentOzar merged commit 94bafa0 into BrentOzarULTD:dev Oct 10, 2023
@Montro1981 Montro1981 deleted the SQL-Server-First-Responder-Kit_3370 branch October 11, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants