Recalling Form Variables in SQL Statements

Results 1 to 2 of 2

Thread: Recalling Form Variables in SQL Statements

  1. #1
    Join Date
    Dec 1969
    Posts
    206

    Default Recalling Form Variables in SQL Statements

    I am having trouble pulling variable that I set through the get command in a form on the previous page when putting it into a SQL statement. I can pull the variables and make them display, but what I want to do is put them in a SQL statement like such:<BR><BR>strSQL= "SELECT * FROM distributor WHERE zip=&#039"&SearchText&"&#039 Order by &#039"&Group&"&#039 desc;"<BR><BR>The &SearchText& is a variable that I have working. The &Group& variable does not work. It is set the exact same way, and called, but it is not recognized. I have tried "&Group&" , &#039&Group&&#039, Group , &Group& , and "Group".<BR><BR>If anyone can help I would apppreciate it.<BR><BR>Brandon

  2. #2
    Join Date
    Dec 1969
    Posts
    206

    Default RE: Recalling Form Variables in SQL Statements

    Hey, I figured it out. Just for anyone who wants to know, it needed parantheses around the variable so that it would execute first.<BR><BR>Thanks,<BR>Brandon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •