Link to home
Start Free TrialLog in
Avatar of triphen
triphen

asked on

SyBase Query Syntax Date Time conversion

Hello Experts,

I have a SyBase database and when I select the field I get

9/19/2016 4:05:00 PM

I want to return only the the time portion in HH:MM 24 hour format....desired return is: 16:05

Another example:

9/19/2016 12:53:00 PM should return 12:53


I cant seem to find the right combination of date/time format to get me this....help?
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try this..

SELECT CONVERT(CHAR(10), DATETIME('2016-01-0 11:10:42.033189'), 118)

Open in new window


Hope it helps !!
Avatar of triphen
triphen

ASKER

Thank you!
a pleasure.

It's probably also worth noting that I believe Pawan's answer relates to Sybase "SQL Anywhere", see:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1570/html/sqlug/BABDBAHF.htm