Skip to Content.
Sympa Menu

freetds - Re: Date Problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James Cameron <cameron AT fax.sno.cpqcorp.net>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Date Problem
  • Date: Thu, 06 Dec 2001 12:03:38 +1100


James,

While you've got the whole date thing in pieces on your workbench, any
idea how I can get a datetime down to the seconds, or whatever precision
it is being stored at?

If I do a

SELECT modify_stmp FROM table [...]

then I get

'Feb 20 2001 10:57AM'

I can get the seconds if I adjust my code as follows:

SELECT CAST(modify_stmp AS VARCHAR(26)) + ' ' +
CAST(DATEPART(SECOND, modify_stmp) AS VARCHAR(2))
FROM table [...]

but this seems somewhat verbose. Is there a better way?

--
James Cameron




Archive powered by MHonArc 2.6.24.

Top of Page