I want to change this codeselect t.Month_date,b.bus_id,b.tour_date,b.[status],b.fare from #temp t left outer join Busdetails b on t.Month_date=b.tour_date ) up I want to change t.Month_date likeCAST(CONVERT(char(8), month_date, 112) AS datetime) dateI tried this but showing error.