Issue Details (XML | Word | Printable)

Key: CORE-1490
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Helen Borrie
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

New builtin function DATEDIFF() implements wrong choice of keywords for expanded syntax

Created: 01/Oct/07 11:14 AM   Updated: 18/Nov/08 01:55 PM
Component/s: Engine
Affects Version/s: 2.1 Beta 1
Fix Version/s: 2.1 RC1

Time Tracking:
Original Estimate: 1 day
Original Estimate - 1 day
Remaining Estimate: 1 day
Remaining Estimate - 1 day
Time Spent: Not Specified
Remaining Estimate - 1 day

Environment: All; affects Fb 2.1 Betas 1 and 2


 Description  « Hide
The expanded syntax for the newly-implemented built-in function is as follows:

DATEDIFF( <timestamp_part> FROM <date_time> FOR <date_time> )

Use of the prepositions FROM and FOR as keywords conveys the wrong semantics. The meaning should be expressed by a semantically correct pair of prepositions.

Suggested:
DATEDIFF( <timestamp_part> FROM <date_time> TO <date_time> )

or
DATEDIFF( <timestamp_part> BETWEEN <date_time> AND <date_time> )

A contracted alternative syntax is available, sans prepositions:

DATEDIFF( <timestamp_part>, <date_time>, <date_time> )

As a temporary measure, the Beta 2 release notes will include a warning that the keywords will change in Beta 3 and recommending use of the contracted syntax for the time being.


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 02/Oct/07 11:38 AM
Changed TO: DATEDIFF( <timestamp_part> FROM <date_time> TO <date_time> )