I would like to change a date value I have into a varchar to allow me to join it to a table with a varchar value. I have looked through the forums come up with some ideas none of them seem to work.
I would like yyyymmdd
However at the moment 5th August 2005 is being returned as
200585. I need 20050805.
This is what I have so far:-
convert(varchar (10), year(run_date)) + convert (varchar (2), month([run_date]),101) + convert(varchar (2),day([run_date]), 101)
This is returning the values without the leading 0.
Thanks
I would like yyyymmdd
However at the moment 5th August 2005 is being returned as
200585. I need 20050805.
This is what I have so far:-
convert(varchar (10), year(run_date)) + convert (varchar (2), month([run_date]),101) + convert(varchar (2),day([run_date]), 101)
This is returning the values without the leading 0.
Thanks