updating a varchar column that contains dates

ac_davis2002
ac_davis2002 used Ask the Experts™
on
hi

I have a database table called contracts. contracts has a varchar column that contains dates

for example 01/12/2009, 01/12/2010 etc

I would like to update the values to yes or no. if the date is in the past then yes, if in the future then no...

can anyone give me an example of the statement i need please
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Database Consultant
Top Expert 2009
Commented:
Update urTable
set DateColumn = case when CONVERT(VARCHAR,datecolumn, 101)  < getdate()  THEN 'Yes' ELSE 'No' end

Author

Commented:
ACE!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial