cancel
Showing results for 
Search instead for 
Did you mean: 

SELECT clause with a DATETIME column in Sybase 15

Former Member
20,094

I'm trying to do a query like this on a table with a DATETIME column.

SELECT * FROM table WHERE the_date = 2011-03-06T15:53:34.890-05:00

I have the following as an string input from an external source:

2011-03-06T15:53:34.890-05:00

I need to perform a query on my database table and extract the row which contains this same date. In my database it gets stored as a DATETIME and looks like the following:

2011-03-06 15:53:34.89

I can probably manipulate the outside input slightly ( like strip off the -5:00 ). But I can't figure out how to do a simple select with the datetime column.

I found the convert function, and style 123 seems to match my needs but I can't get it to work. Here is the link to reference about style 123

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.blocks/html/blocks/block...

Accepted Solutions (0)

Answers (0)