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
 SQL Server Development (2000)
 datetime error

Author  Topic 

kwikwisi
Constraint Violating Yak Guru

283 Posts

Posted - 2008-05-12 : 23:40:13
hi,

i combine two column to show as one like that(Task+ DateCreated) AS TD.
DateCreated is datetime column and Task is nvchar .
when i run my page,i've got error like "Syntax error converting datetime from character string".
Can anyone tell me why?

Thanks.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-12 : 23:48:14
use Task+ CONVERT(nvarchar(20),DateCreated) AS TD
Go to Top of Page

kwikwisi
Constraint Violating Yak Guru

283 Posts

Posted - 2008-05-13 : 00:06:39
hi,

Thanks.
But i want date part only.

quote:
Originally posted by visakh16

use Task+ CONVERT(nvarchar(20),DateCreated) AS TD

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-13 : 00:48:44
Bring back Task, DateCreated and then in your application concatenate them and format DateCreated to date only. You should not be doing this format in SQL Server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-13 : 02:41:41
There are mamny styles available for CONVERT function.
Books Online has excellent example and description.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -