Multiple select query

Results 1 to 3 of 3

Thread: Multiple select query

  1. #1
    warble Guest

    Default Multiple select query

    Hi all, <BR>I need to be able to select more than one variable from a listbox and have the result returned from a sql query. Help Please!

  2. #2
    Join Date
    Dec 1969

    Default RE: Multiple select query

    I&#039m having to guess what you are after here as the question isn&#039t very explanatory so...<BR><BR>Firstly put the multiple word into your select tag <BR>&#060;select multiple name="test"&#062;<BR><BR>Then when you select more than one from the list and submit you will be able to pick up the result.<BR>Request.Form("test") and this will look something like this<BR>1,2 (your options are seperated by commas)<BR><BR>Now when you do your select statement it will look like this:-<BR><BR>SELECT * FROM yourtable WHERE tableid IN (" & Request.Form("test") & ")"

  3. #3
    warble Guest

    Default RE: Multiple select query

    Here&#039s the sql string I get a syntax error<BR>strSQL = "select a.costcenter,a.lastname,a.firstname,a.employeenumb er,count(b.status) as b, b.status, b.shift from bodyopslist as a, bodyopshistory as b where b.status IN(&#039"&medstatus&"&#039) and a.employeenumber=b.employeenumber and a.costcenter IN (" & Request.Form("costcenter") & ") group by a.costcenter,a.lastname,a.firstname,a.employeenumb er,b.status,b.shift order by a.costcenter,a.employeenumber"

Posting Permissions

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