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
Date format when casting as varchar [CORE1341] #1760
Comments
Commented by: ramengo (ramengo) I was thinking to "to_char" command in Oracle, where you can do: Is it possible to have a similar behaviour in FB ? |
Commented by: @asfernandes I would prefer a generic FORMAT function, but this requires we return strings of unknown (at prepare time) length, and we don't support this yet. |
Commented by: ramengo (ramengo) I see. |
Commented by: ramengo (ramengo) Hey, I just want to follow the invite of the Firebird homepage: "Is there a feature you would like to request?"... hehehe |
Commented by: Mustafa Simsek (mussimsek) Hi, i vote for generic Format date-time funciton too. FormatDateTime (format_string, date-time value) = formatted string format_string could be general for other db & languages. d - day(1-31) Best Regards. |
Modified by: @pcisarWorkflow: jira [ 12490 ] => Firebird [ 14899 ] |
Commented by: Andre Litfin (andrelitfin) What about this function? Will this function be integrated in FB 2.5?? At the moment I'm using an UDF, but it's better when it's integrated... |
Modified by: @dyemanovassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Commented by: ramengo (ramengo) Hi, if you implement this functionality into 2.5, then don't forget another similar to format numers. Example 1: Example 2: |
Commented by: @asfernandes I'm marking this as duplicate because it's better to have a unified format routine, as in CORE1314. |
Modified by: @asfernandes |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: ramengo (ramengo)
Duplicates CORE1314
Votes: 4
It would be useful to have a built-in function which formats date when casting as varchar.
For example, the following select:
select cast(current_date as varchar(30))
from RDB$Database
would return:
2007-07-03
while I need different formats like:
03-jul-2007 or 03/07/2007
Same story with timestamp but with time format indication...
The text was updated successfully, but these errors were encountered: