EddieVenus
Technical User
I can make SQL querys that use variable at the end of the query string.
I.E. "SELECT Location FROM t_CustInfo WHERE CompanyName = '" & compname & "'"
But I am having trouble putting the varible into the sting in the middle. What I am trying to do is to have a variable that stands for DISTINCT so that the user has the option to find all the records or just the unique ones. I have this code for it, since it is the logical adoption of the code used to input variables at the end.
"SELECT '" & u & "'CIDresponse FROM t_CircuitID"
in this case u is just a check box, either DISTINCT or null, and if I do this string without the variable I do get the proper records back wether I use DISTINCT or not. Please tell me what I am doing wrong, I have tried many variations of the string and none have worked. Thank you.
I.E. "SELECT Location FROM t_CustInfo WHERE CompanyName = '" & compname & "'"
But I am having trouble putting the varible into the sting in the middle. What I am trying to do is to have a variable that stands for DISTINCT so that the user has the option to find all the records or just the unique ones. I have this code for it, since it is the logical adoption of the code used to input variables at the end.
"SELECT '" & u & "'CIDresponse FROM t_CircuitID"
in this case u is just a check box, either DISTINCT or null, and if I do this string without the variable I do get the proper records back wether I use DISTINCT or not. Please tell me what I am doing wrong, I have tried many variations of the string and none have worked. Thank you.