0

现在我有两个领域:

MEETING_TIME_START  |    MEETING_TIME_END
--------------------+--------------------
 9:30:00.000000AM   |   10:50:00.000000AM
11:00:00.000000AM   |   12:20:00.000000PM
11:00:00.000000AM   |   12:20:00.000000PM
10:00:00.000000AM   |   10:50:00.000000AM

我有一个标准来创建一个新字段并重新格式化时间:

(SUBSTR((D.MEETING_TIME_START),1,5)%concat '- ' %concat SUBSTR((D.MEETING_TIME_END),1,5))

结果如下:

NEW FIELD
------------
09.30- 10.50
11.00- 12.20
11.00- 12.20
10.00- 10.50

我如何调整我的标准来创建这种格式:

PREFERRED OUTPUT
----------------
0930-1050
1100-1220
1100-1220
1000-1050
4

2 回答 2

0

你能试试这个吗?

(SUBSTR((D.MEETING_TIME_START),1,2) || SUBSTR((D.MEETING_TIME_START),4,2) || '-' || SUBSTR((D.MEETING_TIME_END),1,2) || SUBSTR((D.MEETING_TIME_START),4,2))

于 2013-03-05T22:48:13.133 回答
0

如果是 MySQL,我会试试这个:

CONCAT(SUBSTR(D.MEETING_TIME_START,1,2),SUBSTR(D.MEETING_TIME_START,4,2),'-',SUBSTR(D.MEETING_TIME_END,1,2), SUBSTR(D.MEETING_TIME_END,4,2))
于 2013-03-05T22:55:20.397 回答