convert a string to an integer to use in a query

Results 1 to 2 of 2

Thread: convert a string to an integer to use in a query

  1. #1
    Join Date
    Dec 1969
    Posts
    53

    Default convert a string to an integer to use in a query

    hi..hope u can help<BR><BR>i need to be able to do the following<BR>1) retrieve input value from a prompt dialog in javascript, i get a string rite,like this<BR><BR>var id;<BR>id=prompt(&#039Enter the Author Id:&#039, &#039&#039);<BR><BR>2) Now i have to sent this string to another page <BR>like this<BR><BR>window.location.href="author.asp?ident ity=id";<BR><BR>3) in author.asp I need to retrieve this value<BR>in vbscript like this<BR><BR>Dim idfield<BR>idfield = Request.QueryString("identity")<BR><BR>4) the problem comes when i have to use idfield as a search criteria in an sql query where it retrieves a record for a particular id(stored as an integer in the database) I this integer string conversion problem..how do i do it without using forms<BR><BR><BR>thanks

  2. #2
    Nathen Grass Guest

    Default RE: convert a string to an integer to use in a que

    Just include the id field in your WHERE clause without the single quotes.<BR><BR>i.e.<BR>WHERE clause for String: WHERE id = &#039 50&#039<BR><BR>WHERE clause for Integer: WHERE id = 50

Posting Permissions

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