hovercraft
Technical User
I'm receiving a syntax error with the following sql
I would like to use this in vba so that the number of records returned by TOP will be a variable as well as the field my_state and my_city will also be variables all in a loop...but first I'm struggling with the proper syntax.
Could someone please assist with my SQL.
Thanks in advance,
Hovercraft
Code:
UPDATE tmp_tbl_letters SET tmp_tbl_letters.my_print = True
WHERE tmp_tbl_letters.my_id In(SELECT DISTINCT TOP 100 FROM tmp_tbl_letters WHERE tmp_tbl_letters.my_state="oh" AND tmp_tbl_letters.my_city="columbus" ORDER BY my_date);
I would like to use this in vba so that the number of records returned by TOP will be a variable as well as the field my_state and my_city will also be variables all in a loop...but first I'm struggling with the proper syntax.
Could someone please assist with my SQL.
Thanks in advance,
Hovercraft