| 1. |
How Do Convert Or Display The Date Or Time As String? |
|
Answer» Simply use CAST to appropriate CHAR or VARCHAR DATA type (big enough). Example: CREATE TABLE t1 (t time, d date. ts timestamp); Firebird would output TIMES in HH:MM:SS.mmmm format (HOURS, minutes, seconds, milliseconds), and dates in YYYY-MM-DD (year, month, day) format. if you wish a different formatting you can either use SUBSTRING to extract the info from char column, or use EXTRACT to buld a different string: SELECT extract(day from d)||’.’||extract(month from d)||’.‘||extract(year from d) FROMt1; Simply use CAST to appropriate CHAR or VARCHAR data type (big enough). Example: CREATE TABLE t1 (t time, d date. ts timestamp); Firebird would output times in HH:MM:SS.mmmm format (hours, minutes, seconds, milliseconds), and dates in YYYY-MM-DD (year, month, day) format. if you wish a different formatting you can either use SUBSTRING to extract the info from char column, or use EXTRACT to buld a different string: SELECT extract(day from d)||’.’||extract(month from d)||’.‘||extract(year from d) FROMt1; |
|