Data type mismatch

Results 1 to 4 of 4

Thread: Data type mismatch

  1. #1
    Zola Guest

    Default Data type mismatch

    I have passed an ID number via GET.<BR><BR>sql = "SELECT ID, Name, Email, Date, Subject, Body, LinkName, LinkURL FROM GarouBB is fine, but using <BR><BR>WHERE ID=&#039"& ID & "&#039 <BR>or<BR>WHERE ID=" & Request.QueryString("ID") & " (With closing quotes, of course)<BR><BR>gives me a data type mismatch.<BR><BR>When using the second type of syntax for a date, I know that you must use the # symbol for correct display:<BR>(Example: WHERE ID=#" & Request.QueryString("ID") & "#)<BR><BR>Is there some similar rule when using a number? I know my SQL book said the numbers did not need the single quote, but if I remove them from the first type of syntax, I get an error message.<BR><BR>I don&#039t have a preference for syntax as long as it fetches that ID number so the recordset can be displayed. HELP!!!<BR><BR>TIA <BR><BR>Zola<BR>

  2. #2
    Scott Cate Guest

    Default RE: Data type mismatch

    The ID is numeric and doesn&#039t need &#039&#039 for the sql to try this<BR><BR>"where id=" & request.quearystring("id") & ";"

  3. #3
    Michael Clark Guest

    Default RE: Data type mismatch

    Check the data type in the field that you are calling. If it is say for example in is "Long" convert the request variable to long before passing it to your sql statement.<BR><BR>ID = CLng(Request("ID")<BR><BR>WHERE ID = " & ID & "

  4. #4
    Zola Guest

    Default RE: Data type mismatch

    Thanks! All better


Posting Permissions

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