Solved

SQL Time Syntax

Posted on 2014-02-19
4
301 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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