A
Alain
Hi every one,
can anyone help me on this one, I really don't get it
Dim rst As DAO.Database
Dim strSQL As String
Dim intID As Integer
intID = 1
strSQL = "SELECT Sum(AnnualRental) AS SumOfAnnualRental From BasicRental"
& _
" WHERE (DateFrom <= Date() AND DateTo >= Date()) OR (MthToMth =
True)" & _
" GROUP BY IdBranch" & _
" HAVING IdBranch = " & intID & ""
Set rst = CurrentDb.OpenRecordset(strSQL)
The SQL run properly by itself but cannot set it as a recordset
Thanks
can anyone help me on this one, I really don't get it
Dim rst As DAO.Database
Dim strSQL As String
Dim intID As Integer
intID = 1
strSQL = "SELECT Sum(AnnualRental) AS SumOfAnnualRental From BasicRental"
& _
" WHERE (DateFrom <= Date() AND DateTo >= Date()) OR (MthToMth =
True)" & _
" GROUP BY IdBranch" & _
" HAVING IdBranch = " & intID & ""
Set rst = CurrentDb.OpenRecordset(strSQL)
The SQL run properly by itself but cannot set it as a recordset
Thanks