Using the Right function

Discussion in 'ASP General' started by Big Moxy, Nov 30, 2007.

  1. Big Moxy

    Big Moxy Guest

    orderBy is a querystring value which contains 2 characters (e.g.
    orderBy=a0). The first is an "a" or "d" representing the sort sequence
    and the second is a one digit number corresponding to the array index
    of a field names.

    The problem is that I get a type mismatch (Type mismatch:
    'Right(...)' ) on this statement:

    If (Request.Querystring("orderBy").Count = 0) Then
    sortOrder = "ASC"
    sortField = "ID"
    Else
    If Left(orderBy,1) <> "d" Then
    sortOrder = "ASC"
    Else
    sortOrder = "DESC"
    End If
    sortField = columns(Right(orderBy,1))
    End If

    How should I be using the Right function?

    Thank you!
     
    Big Moxy, Nov 30, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    445
  2. =?Utf-8?B?QmlzaG95?=
    Replies:
    0
    Views:
    1,079
    =?Utf-8?B?QmlzaG95?=
    Dec 28, 2006
  3. Bogdan
    Replies:
    1
    Views:
    857
    Bogdan
    Jun 16, 2009
  4. Leon
    Replies:
    3
    Views:
    199
    TaeHo Yoo
    Nov 26, 2004
  5. Oran
    Replies:
    2
    Views:
    626
Loading...

Share This Page