Question

Right now I have two fields:

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

I have a criteria to create a new field and re-format the time:

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

This results with the following:

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

How can i adjust my criteria to create this format:

PREFERRED OUTPUT
----------------
0930-1050
1100-1220
1100-1220
1000-1050
Was it helpful?

Solution

Can you try this?

(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))

OTHER TIPS

If it's MySQL I'd try this:

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))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top