SQL question.

Results 1 to 3 of 3

Thread: SQL question.

  1. #1
    Conrad Guest

    Default SQL question.

    What is the correct syntax for a SQL query where part of the query is a session variable. Such as:<BR><BR>SELECT * FROM my_table WHERE username = &#060;%session("my_var")%&#062;<BR><BR>Should I just drop the parens and quotes?<BR><BR>Thanks.

  2. #2
    KPW Guest

    Default RE: SQL question.

    I think it would be something like:<BR><BR>&#060;% sSql = "SELECT * FROM my_table WHERE username = &#039" & session("my_var") & "&#039" %&#062;<BR><BR>Depending on the data type of my_var, you may or may not need the single quote, or, if it&#039s a date, you would wrap it in # characters.<BR><BR>Hope this helps.

  3. #3
    Conrad Guest

    Default Thank you very much!

    Thank you very much!

Posting Permissions

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