Jitendra Shekhawat

Jitendra Shekhawat

  • NA
  • 1.7k
  • 16k

Incorrect syntax near 'SELECT (month(bill_date) & ', ' & ...

Mar 2 2017 11:15 PM
 how to change access query to sql server 2012
 
 
("SELECT (month(bill_date) & ', ' & year(bill_date)) AS dt, " & _
"count(1) AS nbills, sum(amount) AS tamt, sum(iif(chk_free=1,amount,0)) AS pamt, " & _
"tamt-pamt AS totamt From rec_all Where iif(rec_ref is null,0,rec_ref)<>1 and rw = 0 and bill_date " & _
"between '" & Format(DTfrom(0).Value, "yyyy/mm/dd") & "' and '" & Format(DTfrom(1).Value, "yyyy/mm/dd") & "' and co_code='" & CoCode & "'" & _
"GROUP BY year(bill_date), month(bill_date)")
 

Answers (7)