How to Convert String to Date in this Context

How to Convert String to Date in this Context

Hi!

I have the following code:
  1. SELECT   concat(year(sd."Doc Date"), '-', if(length(month(sd."Doc Date")) = 1, '0', ''), month(sd."Doc Date")) as Month, sd."Source of Rebill", Count(sd."Invoice #") as 'Number of Invoices',  
  2. Count(sd."Credit Memo # (if app)") as 'Credit Memo' , (Count(sd."Credit Memo # (if app)")/Avg(ic."Number of Invoices")*100) as 'Credit Memo %',
  3. (count(sd."Credit Memo # (if app)")/count(sd."Invoice #"))*100 as '% of Billing Errors'

  4. FROM "Sales Detail" sd
  5. inner join "Invoices Count per Month" ic on concat(year(sd."Doc Date"), '-',  if(length(month(sd."Doc Date")) = 1, '0', ''), month(sd."Doc Date")) = ic."Month"

  6. group by  concat(year(sd."Doc Date"), '-', if(length(month(sd."Doc Date")) = 1, '0', ''), month(sd."Doc Date")), sd."Source of Rebill"
Question:
The first column comes out as a text string. How do I convert it to a date field? I tried using str_to_date() but I could not get it to work. Any help would be GREATLY appreciated. Thanks!