?
Solved

GetDate Seconds

Posted on 2006-10-24
3
Medium Priority
?
2,402 Views
Last Modified: 2008-01-09
I am using GetDate() as a default in a table item

Strangely it seems to round the time down to the minute..

ie

2006-10-24 20:53:00
 
How do I get it to accurately state seconds?
0
Comment
Question by:MaximusMeridus
[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
3 Comments
 
LVL 9

Accepted Solution

by:
gpompe earned 2000 total points
ID: 17799388
Probably the field is smalldatetime. Change to datetime and done.
0
 
LVL 43

Expert Comment

by:Eugene Z
ID: 17799405
use datetime instead of smalldatetime

select cast(getdate() as smalldatetime),getdate()

result:
2006-10-24 17:04:00         2006-10-24 17:04:10.217
0
 
LVL 15

Expert Comment

by:DonKronos
ID: 17799406
If the column is defined as "smalldatetime" then the accuracy will only be to minutes.  You need a data type of "datetime" to get seconds and milliseconds.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

762 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