Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 convert ':00:00.000' to varchar

Author  Topic 

saravananpk
Starting Member

3 Posts

Posted - 2002-07-22 : 18:41:28
if i convert or cast ':00:00.000' to a varchar iam getting the following error.

convert(varchar(20),':00:00.000')
and
cast(':00:00.000' as varchar(20))

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '00'.

how to convert that to a varchar.

thanks and regards,
spk.





robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-07-22 : 20:24:59
Um, you might not believe this, but ':00:00.000' is ALREADY a varchar value, you don't need to convert it at all.

FWIW, as a datetime value, ':00:00.000' is invalid, '00:00:00.000' whould need to be used.

Go to Top of Page
   

- Advertisement -