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-issue-importer opened this issue Oct 17, 2007 · 7 comments
Closed

Inconsistent DATEDIFF behaviour [CORE1522] #1937

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

Comments

@firebird-issue-importer

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 17, 2007

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 29, 2007

Modified by: @pcisar

Link: This issue is related to QA193 [ QA193 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2008

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 7, 2008

Commented by: @pmakowski

Q/A test ok

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 7, 2008

Modified by: @pmakowski

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants