Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datediff

Status
Not open for further replies.

DanHD

Technical User
Dec 1, 2008
98
NL
hello,

i need to count the difference between two dates. In the database they use the format

2010-03-22 13:53:38.000
and
2010-09-10 21:30:14.717

I've tried difference functions, but each time I receive an error 'Incorrect syntax near '13'.

How can I solve this?

Dan
 
hoi markros

for eample:

select datediff(day,2010-03-19 09:50:09.000, 2010-05-27 10:46:31.000)

results in:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '09'.


Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top