xcaliber2222
Programmer
Hello,
I have a strSQL statement where I'm taking in arguments that are building the 'IN' part of my WHERE clause. For example:
The strCustCodeList is taking in values from the database table as such: 123454,123456,123457
Can someone please show me how to form this string so it will come in as such: ('123454','123456','123457') with the single quotes? Unfortunately, these are varchar values in the database and dong a cast or convert on these is not an option either.
Any help would be greatly appreciated.
Thank you,
Alejandro
I have a strSQL statement where I'm taking in arguments that are building the 'IN' part of my WHERE clause. For example:
Code:
strSQL = "SELECT " & _
"invoice.invoice_num, " & _
"invoice.invoice_date, " & _
"pickup.zip_code, " & _
"delivery.company_name, " & _
"job.weight, " & _
"job.dim_weight, " & _
"WHERE " & _
" invoice.invoice_date = '" & dttmStart & "' AND " & _
" invoice.cust_code IN '" & strCustCodeList & "'"
The strCustCodeList is taking in values from the database table as such: 123454,123456,123457
Can someone please show me how to form this string so it will come in as such: ('123454','123456','123457') with the single quotes? Unfortunately, these are varchar values in the database and dong a cast or convert on these is not an option either.
Any help would be greatly appreciated.
Thank you,
Alejandro