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!

Conversion Error from DateTime

Status
Not open for further replies.

luvmy2Js

IS-IT--Management
Sep 1, 2010
43
US
I have the below code:

DATEADD(DAY,-1,CONVERT(nvarchar, DecryptBykey([last day of work])))

and it is giving me the below error:

Conversion failed when converting datetime from character string.


I have tried everything I know how, please help!!

Thanks,
 
You have bad data in your [last day of work] column.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Why you're trying to convert Last Day of work to nvarchar?

Try converting to datetime in that code. Also, do you know the format the encrypted Last day of work is? If you know the format, try using it in the CONVERT function as last parameter.

PluralSight Learning Library
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top