Record Set question

Results 1 to 4 of 4

Thread: Record Set question

  1. #1
    Newt Guest

    Default Record Set question

    When I get column values from a Recordset, even if they are numbers, I get a mismatch when I try to add them together. I use the isNumberic function and they are indeed not numbers. However, if I assign those values to a local variable, they become numeric and I can apply math to them.<BR><BR>Any short cuts to this?<BR><BR>Newton

  2. #2
    Join Date
    Dec 1969

    Default RE: Record Set question

    With unlike VB you can not assign a variable type to a variable<BR><BR>Dim MyCnt as integer<BR>Dim MyVar as String<BR><BR>The script just decides what type it is as you use it <BR><BR>When calling an integer type criteria in a query you cannot put single quotes around it<BR><BR>Select * From Table Where TableID= & MyCnt<BR><BR>some times when I have problems getting the code to recognize a variable value as integer I will do this <BR><BR>Select * From Table Where TableID= & MyCnt*1<BR><BR>When Calling date values as criteria at least with MS Access you need to put the # around it<BR>Select * From Table Where Date=#" & VarDate & "#;"<BR><BR>all other type use single quotes<BR><BR>Select * From Table Where SomeTextField=&#039" & MyVar & "&#039;"<BR><BR>I hope this helps<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Record Set question

    You can also use the CInt function within vbscript i.e. if you assign the value to some variable custID then you can convert the value to integer by:<BR><BR>CInt(custID)<BR><BR>This should do the job.

  4. #4
    Thanks guys- Newt Guest

    Default RE: Record Set question (NT)


Posting Permissions

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