Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if then for special characters in Select Statement

Status
Not open for further replies.

ynott

Technical User
Sep 26, 2000
49
US
Here's the last part of a Select statement after the LIKE portion:

SQL = SQL & "' & A1 & A2 & A3 & A4 & A5 & A6 & A7 &"'"

A1 to A7 will analysis each character in the 7 character querystring. I'm using a hyphen in the query to indicate if user wants a wildcard in this position. Ex, *ABC*23, or 1A*C12*, etc. Since a * caused a problem in the input querystring, I cheated and used a - in place of a * within the seven characters. Ex, -ABC-23, or 1A-C12-. I created an if/then statement, Ex,

if left(cc,1) = "-" then
A1 = "'%"
else A1 = '"'
end if

I would insert A1 in this to, but I'm just showing the start of the statemnt with the single and double quote differences

But as you can tell A1 can't handle how I need to label the % " and ' characters in the statement.

How can I get around this. I seem to be going around in circles.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top