Solved

SQL Time Syntax

Posted on 2014-02-19
4
277 Views
Last Modified: 2014-02-19
Hey guys,

I am using SyBase SQL Anywhere v10. I have a column called timestart and issuing the command "select timestart from transaction" returns "1/31/2013 4:19:03 PM". I need it to return "2013-01-31 16:19:03". I know there is a convert function, but I can't seem to get it to work.

Any ideas?
0
Comment
Question by:triphen
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
ID: 39872148
try:

convert(varchar, [your_date_field_here] ,120)

Sybase documentation for this is available at:
http://dcx.sybase.com/1001/en/dbrfen10/rf-convert.html

or my article on SQL Sever date styles (you will see the similarity immediately)
0
 

Author Closing Comment

by:triphen
ID: 39872159
You rock! Thanks!
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 39872562
no problem, glad I could help. cheers, Paul
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now