sql 7 query

Results 1 to 2 of 2

Thread: sql 7 query

  1. #1
    warble Guest

    Default sql 7 query

    I&#039m running sql server 7.0 and need to use the IN statement this doesn&#039t work: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"<BR>SQL 7 requires single quotes around each variable along with comma. Help Please.

  2. #2
    LeeAnnie Guest

    Default RE: sql 7 query

    One thing jumps out....<BR>count(b.status) as b<BR>bodyopshistory as b <BR><BR>You are giving them the same aliases. I know they are two different objects, but this may confuse things. Hope this helps<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