SQL Statements

Results 1 to 2 of 2

Thread: SQL Statements

  1. #1
    Join Date
    Dec 1969
    Posts
    716

    Default SQL Statements

    Hey all,<BR><BR>I have been coding standard SQL queries for awhile now, but have recently started learning how to code ASPs.<BR><BR>I have used the "sqlstmt" line in ASPS - my question is as follows:<BR><BR>I want to pass-through a "Name" variable (entered into a textbox in "showbydate.html". This variable I would then like to use in the SQL statement line.<BR><BR>In SQL I would do the following:<BR><BR>SELECT * FROM Staff WHERE Date = %date% ORDER by Date;<BR><BR>(Date is a numerical field)<BR><BR>So how do I use variables in ASP SQL statements - the same way?

  2. #2
    Zola Guest

    Default RE: SQL Statements

    The basic command for "whatever it is" would be <BR><BR>SELECT * FROM Staff WHERE Password = &#039" & password & "&#039<BR><BR>For a date, I think you need the pound sign:<BR><BR>SELECT * FROM Staff WHERE Date = #" & password & "#<BR><BR>At least that is true for Access.<BR>

Posting Permissions

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