Whats wrong with this SQL?

Results 1 to 3 of 3

Thread: Whats wrong with this SQL?

  1. #1
    Curtis Guest

    Default Whats wrong with this SQL?

    CustID = Request.Cookies("UserID")<BR><BR>strSQL = "Select * From tblOrder where CustID = "<BR>strSQL = strSQL & CustID<BR>rs.open strSQL, cn<BR><BR>I get this error:<BR>&#039;Data type mismatch in criteria expression.&#039;

  2. #2
    Curtis Guest

    Default RE: Whats wrong with this SQL?

    never mind, got it.....<BR>I didn&#039;t think you had to use quotes everywhere for this<BR><BR>strSQL = "Select * From tblOrder where ((CustID) = &#039;" & CustID & "&#039;)"

  3. #3
    Join Date
    Dec 1969

    Default use ints for ints & strings for strings

    if CustID is a string column, then you need quotes. if it is an int column then you don&#039;t need quotes. if CustID only consists of integers you should make the field data type integers in your table.

Posting Permissions

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