Now that I have help from this forum's,I have the sql command which can produce the correct result in ACCESS. However when I brought that to use in ASP the error said like this..
Microsoft JET Database Engine error '80040e14'
The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
what did I do wrong ? my asp code is ….
Dim rsBill
set rsBill = Server.CreateObject("ADODB.Recordset")
rsBill.ActiveConnection = Conn_string<br>
rsBill.Source ="select sum(tbt.bill_total) as bill_total ,iif(sum_vat_total is null, 0, sum_vat_total) as vat_total, iif(sum_vat_total is null, 0, sum_vat_total) + sum(bill_total) as sum_of_all, month(showndate) as month from tbl_bill_total tbt left join (select sum(vat_total) as sum_vat_total , month(showndate) as month from tbl_vat_bill_total where if_paid = true and year(showndate) = 2013 group by month(showndate)) tvt on tvt.month = month(tbt.showndate) where year(showndate) = 2013 group by month(showndate) , sum_vat_total"
rsBill.CursorType = 0
rsBill.CursorLocation = 3
rsBill.LockType = 3
rsBill.Open()
rsBill.PageSize = 20
I've tried for several days to find out what's wrong but still couldn't get it.