|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Type mismatch error
I am getting the following error:
Microsoft VBScript runtime (0x800A000D) Type mismatch: '[string: "MND3"]' at the following line of code: CCID = Right(Request("CourseNumber"),Len(Request("CourseNumber") - 3)) It's a simple problem: as part of a data string I am receiving an identity that is either one or two numbers long and is sometimes prefixed by the letters MND (say MND3 or MND62). I need to strip the MND out and use only the numbers. The code used follows: If Left(Request("CourseNumber"),3) = "MND" then CCID = Right(Request("CourseNumber"),Len(Request("CourseNumber") - 3)) Else CCID = Request("CourseNumber") End If The logic seems sound, but I am getting the type mismatch error. Any ideas how to fix it? |
|
#2
|
|||
|
|||
|
Check the parenthesis
You have:
CCID = Right(Request("CourseNumber"),Len(Request("CourseNumber") - 3)) Try this instead CCID = Right(Request("CourseNumber"),Len(Request("CourseNumber")) - 3) Notice the closed parenthesis before the -3? Smartbs www.accessneeds.com |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Type mismatch error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|