Connecting Tech Pros Worldwide Help | Site Map

conversion from varchar

Newbie
 
Join Date: Feb 2008
Posts: 13
#1: Feb 24 '09
I have a column named entrydate in my table as datatype varchar as following
mm/dd/yyyy . How can I convert the column to datetime format..

I tried the following but i got an error


select convert(datetime,entrydate,1) from timeentry


I got the following error

::Conversion failed when converting datetime from character string.
Newbie
 
Join Date: Jul 2007
Posts: 9
#2: Feb 24 '09

re: conversion from varchar


Try CAST instead of CONVERT


SELECT CAST(entrydate AS datetime) FROM timeentry
Reply