Solved

SQL Time Syntax

Posted on 2014-02-19
4
319 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 49

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 49

Expert Comment

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

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

707 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