Solved

SQL Time Syntax

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RAISERROR WITH NOWAIT 2 29
Reformat SQL - so SSRS can read the columns 25 46
Need multiple Group By's 8 53
Can a Trigger trigger a Trigger? 4 46
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses

734 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