Hello,
I don't use Access very often, more of an Excel user, so my knowledge of Access is very basic. I'm hoping the fine folks in this forum can give me guidance with respect to my problem.
I have a simple delete query where I need to delete entire records based on a value in a single column. I have a list of 52 records that need to be deleted based on the value in the usiteid column. Since I don't want to type "," more than 100 times I bring the list of values to delete into MS Word and manipulate the list so the values are separated by ",". A short example: “08CS01201”,”08CS01203”,”08CS01903”. I put this into the query as part of the WHERE IN statement. Below is my very short delete query using the short list above.
DELETE VegStop.*, VegStop.[usiteid]
FROM VegStop
WHERE VegStop.[usiteid] In (“08CS01201”,”08CS01203”,”08CS01903”);
I usually create this kind of statement via the SQL View. But, when I switch to the Design View, the values inside the IN() look like the following:
[“08CS01201”],[”08CS01203”],[”08CS01903”]
Thinking this is an MS Word problem, I copied the manipulated list into NotePad and then copied it into the SQL View in Access. When I displayed the Design View, the brackets were back.
When I tried running this query, each of the bracketed values is being treated as a parameter requiring input.
I really don't want to have to type 50 or more values into the IN statement via the Design View. So, I was wondering if there is something I'm doing wrong or if I missed a step in the copy/paste manipulation, or perhaps something else entirely?
Thanks for your help.
George Teachman
I don't use Access very often, more of an Excel user, so my knowledge of Access is very basic. I'm hoping the fine folks in this forum can give me guidance with respect to my problem.
I have a simple delete query where I need to delete entire records based on a value in a single column. I have a list of 52 records that need to be deleted based on the value in the usiteid column. Since I don't want to type "," more than 100 times I bring the list of values to delete into MS Word and manipulate the list so the values are separated by ",". A short example: “08CS01201”,”08CS01203”,”08CS01903”. I put this into the query as part of the WHERE IN statement. Below is my very short delete query using the short list above.
DELETE VegStop.*, VegStop.[usiteid]
FROM VegStop
WHERE VegStop.[usiteid] In (“08CS01201”,”08CS01203”,”08CS01903”);
I usually create this kind of statement via the SQL View. But, when I switch to the Design View, the values inside the IN() look like the following:
[“08CS01201”],[”08CS01203”],[”08CS01903”]
Thinking this is an MS Word problem, I copied the manipulated list into NotePad and then copied it into the SQL View in Access. When I displayed the Design View, the brackets were back.
When I tried running this query, each of the bracketed values is being treated as a parameter requiring input.
I really don't want to have to type 50 or more values into the IN statement via the Design View. So, I was wondering if there is something I'm doing wrong or if I missed a step in the copy/paste manipulation, or perhaps something else entirely?
Thanks for your help.
George Teachman