Hi All
I'm trying to run an SQL query in VBA that will update the top 5 records only
Below is what I have, however I keep getting an error saying SQL needs a semi colon (which I have).
Would anyone know how I can update only the top x records with a WHERE clause?
Thanks all for you help!
Sub updateuserid2()
'Updatecaserecords
Dim SQL As String
SQL = "UPDATE Cases SET Cases.Status = 'Assigned' WHERE Cases.Status ='UNALLOCATED' ORDER BY Cases.Status LIMIT 5;"
DoCmd.RunSQL SQL
End Sub
I'm trying to run an SQL query in VBA that will update the top 5 records only
Below is what I have, however I keep getting an error saying SQL needs a semi colon (which I have).
Would anyone know how I can update only the top x records with a WHERE clause?
Thanks all for you help!
Sub updateuserid2()
'Updatecaserecords
Dim SQL As String
SQL = "UPDATE Cases SET Cases.Status = 'Assigned' WHERE Cases.Status ='UNALLOCATED' ORDER BY Cases.Status LIMIT 5;"
DoCmd.RunSQL SQL
End Sub