Android Question Smartstring with ExecQuery (which is actually an ExecQuery2)

JonnyCav

Member
Here's the code and I understand that in a normal ExecQuery2 there would be a " before the word Array. I have had to revert to smartstring because ' space underscore' doesn't seem to work.
I keep getting errors regarding quotation marks however I try.

Can anyone spot the mistake?
B4X:
Dim query As String =$"
    SELECT attendance.groupName, attendance.studentName, studenttotalattendance.attendCount, studenttotalscore.scoreCount
    FROM attendance
    JOIN studenttotalattendance
    ON attendance.studentID = studenttotalattendance.studentID
    JOIN studenttotalscore
    ON attendance.studentID = studenttotalscore.studentID
    WHERE studenttotalattendance.classPeriod = ? AND studenttotalattendance.classYear= ?,Array As String(period,AcYear))
    "$
    rs = Starter.sql.ExecQuery(query)
 
Solution
Can anyone spot the mistake?
Should be:
B4X:
dim query As String =$"
    SELECT attendance.groupName, attendance.studentName, studenttotalattendance.attendCount, studenttotalscore.scoreCount
    FROM attendance
    JOIN studenttotalattendance
    ON attendance.studentID = studenttotalattendance.studentID
    JOIN studenttotalscore
    ON attendance.studentID = studenttotalscore.studentID
    WHERE studenttotalattendance.classPeriod = ? AND studenttotalattendance.classYear= ?
    "$
 rs = Starter.sql.ExecQuery2(query,Array As String(period,AcYear))

Mahares

Expert
Licensed User
Longtime User
Can anyone spot the mistake?
Should be:
B4X:
dim query As String =$"
    SELECT attendance.groupName, attendance.studentName, studenttotalattendance.attendCount, studenttotalscore.scoreCount
    FROM attendance
    JOIN studenttotalattendance
    ON attendance.studentID = studenttotalattendance.studentID
    JOIN studenttotalscore
    ON attendance.studentID = studenttotalscore.studentID
    WHERE studenttotalattendance.classPeriod = ? AND studenttotalattendance.classYear= ?
    "$
 rs = Starter.sql.ExecQuery2(query,Array As String(period,AcYear))
 
Upvote 1
Solution
Top