Select statement with a list in the where clause
630617May 9 2008 — edited May 21 2008Hi all,
I need to know how to form a sql statement with a list of values as the where clause. Additionally, The values in the list will be slightly different from the values in the database and I can't figure that part out either. To be more specific:
I am writing a VB executable where the user will click on a folder in my treeview and the contents of that folder will show up in a listview. These files wil all be zip files named after the values I will be searching in the database. However, the zip file name will be void of two dashes whereas the database values will have dashes inserted. I.e. see matrix below on the left are an example of the zip filenames that will make up the list to be put into the where clause while on the right is an example of the values to search in the database:
MTS0601492.zip MTS-06-01492
PMD0701526.zip PMD-07-01526
AIR0501234.zip AIR-05-01234
etc.... etc...
In some cases the length of the string will vary slightly so parsing isn't an option. Any help wuld be greatly appreciated.
Thanks