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 2008 Forums
 Transact-SQL (2008)
 convert nvarchar to date

Author  Topic 

new_developer
Starting Member

18 Posts

Posted - 2012-09-17 : 03:42:23
hi for all
I used this query to find the date in table which
is larger than current
I have use this query
select * from notification where
convert(datetime, timetofinish, 101)>getdate()

but it's give me this error
conversion failed when converting date and/ or time from character string
any one can correct to me
many tahnks

stepson
Aged Yak Warrior

545 Posts

Posted - 2012-09-17 : 04:38:01
TimeToFinish has some value that isn't in the right format to convert

You can use isdate() to verify, inspect the value

http://msdn.microsoft.com/en-us/library/ms187347.aspx


Go to Top of Page

Mike Jackson
Starting Member

37 Posts

Posted - 2012-09-17 : 08:32:13
you would need to supply us with some examples of your data

Mike
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-09-17 : 11:12:17
see

http://visakhm.blogspot.com/2011/12/why-iso-format-is-recommended-while.html

to understand how to pass dates in non ambiguos format

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -