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

Add builtin functions MODIFY_DATE, MODIFY_TIME [CORE5623] #5889

Open
firebird-automations opened this issue Sep 22, 2017 · 1 comment
Open

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @livius2

If you consider new functions then much common will be
Of course it's just a suggestion of a name and syntax,

MODIFY_DATE([SET] {DAY | MONTH | YEAR } <value> FOR <date or timestamp>)

MODIFY_DATE(DAY 1 FOR '2017-09-22') -- 2017-09-01
MODIFY_DATE(MONTH 1 FOR '2017-09-22') -- 2017-01-22
MODIFY_DATE(YEAR 2000 FOR '2017-09-22') -- 2000-09-22

and

MODIFY_TIME([SET] {HOUR | MINUTE | SECOND | MILLISECOND } <value> FOR <date or timestamp>)

MODIFY_TIME(HOUR 15 FOR '08:06:22') -- '15:06:22'
MODIFY_TIME(MINUTE 15 FOR '08:06:22') -- '08:15:22'
MODIFY_TIME(SECOND 1 FOR '08:06:22') -- '08:06:01'
...

maybe name should be RECODE_DATE, REPLACE_DATE...

@firebird-automations
Copy link
Collaborator Author

Modified by: @livius2

description: If you consider new functions then much common will be
Of course it's just a suggestion of a name and syntax,

MODIFY_DATE([SET] {DAY | MONTH | YEAR } <value> FOR <date or timestamp>)

MODIFY_DATE(DAY 1 FOR '2017-09-22') -- 2017-09-01
MODIFY_DATE(MONTH 1 FOR '2017-09-22') -- 2017-01-27
MODIFY_DATE(YEAR 2000 FOR '2017-09-22') -- 2000-09-22

and

MODIFY_TIME([SET] {HOUR | MINUTE | SECOND | MILLISECOND } <value> FOR <date or timestamp>)

MODIFY_TIME(HOUR 15 FOR '08:06:22') -- '15:06:22'
MODIFY_TIME(MINUTE 15 FOR '08:06:22') -- '08:15:22'
MODIFY_TIME(SECOND 1 FOR '08:06:22') -- '08:06:01'
...

maybe name should be RECODE_DATE, REPLACE_DATE...

=>

If you consider new functions then much common will be
Of course it's just a suggestion of a name and syntax,

MODIFY_DATE([SET] {DAY | MONTH | YEAR } <value> FOR <date or timestamp>)

MODIFY_DATE(DAY 1 FOR '2017-09-22') -- 2017-09-01
MODIFY_DATE(MONTH 1 FOR '2017-09-22') -- 2017-01-22
MODIFY_DATE(YEAR 2000 FOR '2017-09-22') -- 2000-09-22

and

MODIFY_TIME([SET] {HOUR | MINUTE | SECOND | MILLISECOND } <value> FOR <date or timestamp>)

MODIFY_TIME(HOUR 15 FOR '08:06:22') -- '15:06:22'
MODIFY_TIME(MINUTE 15 FOR '08:06:22') -- '08:15:22'
MODIFY_TIME(SECOND 1 FOR '08:06:22') -- '08:06:01'
...

maybe name should be RECODE_DATE, REPLACE_DATE...

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

No branches or pull requests

1 participant