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

Inconsistent DATEDIFF behaviour [CORE1522] #1937

Closed
firebird-automations opened this issue Oct 17, 2007 · 7 comments
Closed

Inconsistent DATEDIFF behaviour [CORE1522] #1937

firebird-automations opened this issue Oct 17, 2007 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @asfernandes

Is related to QA193

From a Russian newsgroup:

----------

I have discovered that different logic is used for operations with date and time parts.

For date:

DATEDIFF(MONTH, CAST('30.01.2007' AS DATE), CAST('31.01.2007' AS
DATE)) returns 0,

DATEDIFF(MONTH, CAST('31.01.2007' AS DATE), CAST('01.02.2007' AS
DATE)) returns 1.

So the result value changes at the month boundary.

For time:

DATEDIFF(HOUR, CAST('01:59:59' AS TIME), CAST('02:59:58' AS
TIME)) returns 0,

DATEDIFF(HOUR, CAST('01:59:59' AS TIME), CAST('02:59:59' AS
TIME)) returns 1.

So the integer number of hours is always returned.

Is it intentional? If so, why?

----------

Third query should return 1.

Commits: e443c2b

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA193 [ QA193 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 13325 ] => Firebird [ 14005 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pmakowski

Q/A test ok

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment