A
Al
Hi,
I hope someone can help me with this because I cannot see what I'm doing
wrong. I am using a variable (txtSinList) to hold a string that is used
inside a pass-thru query. The string is quite long and listed below. When I
step through the code, I see that it is only seeing part of the string and
concatenating it right after Copper. I have included the partial string
contained in the variable below also.
Original string:
txtSinList = "Analyte = 'Aluminum, Total' or Analyte = 'Antimony, Total'or
Analyte = 'Arsenic, Total'or Analyte = 'Barium, Total'or Analyte =
'Beryllium, Total'" & _
"or Analyte = 'Cadmium, Total' or Analyte = 'Calcium, Total' or Analyte =
'Chromium, Total'" & _
"or Analyte = 'Copper, Total' or Analyte = 'Cyanide, Total' or Analyte =
'Iron, Total' or Analyte = 'Lead, Total' or Analyte = 'Magnesium, Total'" & _
"or Analyte = 'Manganese, Total' or Analyte = 'Mercury, Total' or Analyte =
'Nickel, Total' or Analyte = 'Potassium, Total' or Analyte = 'Selenium,
Total'" & _
"or Analyte = 'Silicon, Total' or Analyte = 'Silver, Total' or Analyte =
'Sodium, Total' or Analyte = 'Thallium, Total' or Analyte = 'Zinc, Total'"
What is contained in the txtSinList variable at runtime:
"Analyte = 'Aluminum, Total' or Analyte = 'Antimony, Total'or Analyte =
'Arsenic, Total'or Analyte = 'Barium, Total'or Analyte = 'Beryllium, Total'or
Analyte = 'Cadmium, Total' or Analyte = 'Calcium, Total' or Analyte =
'Chromium, Total'or Analyte = 'Cop"
Here is the SQL statement that works but only brings up some of the
requested analytes listed:
strSQL = "SELECT * FROM Customer WHERE StartDate >= '" & C1 & "' and
StartDate <= '" & C2 & "' and (ClientID = '" & txtClList & "') and (" &
txtSinList & ") and (sampname <> 'Finished') order by sampname, Analyte,
Ordno asc;"
Is there a limit to the string length that can be used inside a variable
like this?
I hope this makes sense. Thank you for your help.
Al
I hope someone can help me with this because I cannot see what I'm doing
wrong. I am using a variable (txtSinList) to hold a string that is used
inside a pass-thru query. The string is quite long and listed below. When I
step through the code, I see that it is only seeing part of the string and
concatenating it right after Copper. I have included the partial string
contained in the variable below also.
Original string:
txtSinList = "Analyte = 'Aluminum, Total' or Analyte = 'Antimony, Total'or
Analyte = 'Arsenic, Total'or Analyte = 'Barium, Total'or Analyte =
'Beryllium, Total'" & _
"or Analyte = 'Cadmium, Total' or Analyte = 'Calcium, Total' or Analyte =
'Chromium, Total'" & _
"or Analyte = 'Copper, Total' or Analyte = 'Cyanide, Total' or Analyte =
'Iron, Total' or Analyte = 'Lead, Total' or Analyte = 'Magnesium, Total'" & _
"or Analyte = 'Manganese, Total' or Analyte = 'Mercury, Total' or Analyte =
'Nickel, Total' or Analyte = 'Potassium, Total' or Analyte = 'Selenium,
Total'" & _
"or Analyte = 'Silicon, Total' or Analyte = 'Silver, Total' or Analyte =
'Sodium, Total' or Analyte = 'Thallium, Total' or Analyte = 'Zinc, Total'"
What is contained in the txtSinList variable at runtime:
"Analyte = 'Aluminum, Total' or Analyte = 'Antimony, Total'or Analyte =
'Arsenic, Total'or Analyte = 'Barium, Total'or Analyte = 'Beryllium, Total'or
Analyte = 'Cadmium, Total' or Analyte = 'Calcium, Total' or Analyte =
'Chromium, Total'or Analyte = 'Cop"
Here is the SQL statement that works but only brings up some of the
requested analytes listed:
strSQL = "SELECT * FROM Customer WHERE StartDate >= '" & C1 & "' and
StartDate <= '" & C2 & "' and (ClientID = '" & txtClList & "') and (" &
txtSinList & ") and (sampname <> 'Finished') order by sampname, Analyte,
Ordno asc;"
Is there a limit to the string length that can be used inside a variable
like this?
I hope this makes sense. Thank you for your help.
Al