I've searched all over and can't find any info in Frontbase documentation or, for that matter, SQL92-related docs...does Frontbase have functions equivalent to datepart/date_part, or date_format as found in other RDBMSes? I need to output a timestamp column as a formatted string, and the correct syntax for Frontbase eludes me.
问问题
113 次
1 回答
0
可能有更好的方法来做到这一点,但是强制转换、提取和字符串连接的组合给了我想要的结果:
SELECT CAST(EXTRACT(month FROM mytimestampcol) AS VARCHAR(2)) || '/' || CAST(EXTRACT(day FROM mytimestampcol) AS VARCHAR(2)) || '/' || CAST(EXTRACT(year FROM mytimestampcol) AS VARCHAR(4)) AS "Begin Date" FROM mytable
产生“mm/dd/yyy”格式。
许多 SQL92 函数参考之一:http: //www.faircom.com/doc/sqlref/#12959.htm
于 2014-08-29T12:24:41.030 回答