It doesn't run coz' the query seems incorrect. Yes, access database support CLng and Val functions.
The original code was: (It is in MySQL script)
SqlQuery = "SELECT COUNT(*) AS Report_ID,q1.Report_Name,q1.Report_Owner FROM (SELECT Report_ID,Report_Name,Report_Owner FROM tbl_Monday UNION ALL SELECT Report_ID,Report_Name,Report_Owner FROM tbl_Tuesday UNION ALL SELECT Report_ID,Report_Name,Report_Owner FROM tbl_Wednesday) q1 INNER JOIN(SELECT Report_ID,Report_Name,Report_Owner FROM tbl_Monday UNION ALL SELECT Report_ID,Report_Name,Report_Owner FROM tbl_Tuesday UNION ALL SELECT Report_ID,Report_Name,Report_Owner FROM tbl_Wednesday) q2 on Cast(q1.Report_ID as Integer) + q1.Report_Name + q1.Report_Owner >= Cast(q2.Report_ID as Integer) + q2.Report_Name + q2.Report_Owner GROUP BY q1.Report_ID,q1.Report_Name,q1.Report_Owner"
My problem in that code is that Cast function is not supported in ms access and I've search in the internet that CLng, CInt and Val functions can substitute for Cast, but unfortunately, it still gives me an error 
for the below code
Cast(q1.Report_ID as Integer) + q1.Report_Name + q1.Report_Owner >= Cast(q2.Report_ID as Integer) + q2.Report_Name + q2.Report_Owner
i've converted it to CLng or CInt, but still it doesn't work.
CInt(Val(q1.Report_ID)) + q1.Report_Name + q1.Report_Owner >= CInt(Val(q2.Report_ID)) + q2.Report_Name + q2.Report_Owner
CLng(Val(q1.Report_ID)) + q1.Report_Name + q1.Report_Owner >= CLng(Val(q2.Report_ID))
Bookmarks