Date Problem

James Cameron cameron at fax.sno.cpqcorp.net
Wed Dec 5 20:03:38 EST 2001


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



More information about the FreeTDS mailing list