Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    494

    Unanswered: paging 001+001=002 <> 2

    I have a database table with field as a three digit number like 001 (I did that because when I was searching for example 1, it would bring all the numbers which included 1, like 1, 10, 11, 12...100...). I have the following so far:
    Code:
    <%pagingurl = "<a href=""thechapter.asp" & "?number=" & rs("chapter")
         pagingurl = pagingurl & "&recordType=" & rs("recordType")
                    If Keyword <> "" then pagingurl = pagingurl & "&Keyword=" & Keyword
                    If Keyword <> "" then pagingurl = pagingurl & "&Keywordb=" & Keywordb
                    If Keyword <> "" then pagingurl = pagingurl & "&Keywordc=" & Keywordc
                    If Keyword <> "" then pagingurl = pagingurl & "&Keywordd=" & Keywordd
                    If Keyword <> "" then pagingurl = pagingurl & "&Keyworde=" & Keyworde
                    If Keyword <> "" then pagingurl = pagingurl & "&Keywordf=" & Keywordf
    If spoke<> "" then pagingurl = pagingurl & "&spoke=" & spoke
    
    
    If   request.QueryString("book_spoke")="Book_Spoke" then pagingurl = pagingurl & "&book_spoke=Book_Spoke"
    
    If   request.QueryString("chapter_spoke")="Chapter_Spoke" then pagingurl = pagingurl & "&chapter_spoke=Chapter_Spoke"
    
    If   request.QueryString("verse_spoke")="Verse_Spoke" then pagingurl = pagingurl & "&verse_spoke=Verse_Spoke"
    
    pagingurl = pagingurl & "&text_data=yes" 
    pagingurl = pagingurl & """>" & rs("book_title") & "&nbsp;" & rs("chap") + 1 & "</a> "
    
    response.write pagingurl%>
    <%pagingurl = "<a href=""thechapter.asp" & "?number=" & rs("chapter")
    (1st line)
    I need to somehow add 001 from rs("chapter") with 001 so that it may equal to 002 and not 2. How can I fix that?

  2. #2
    Join Date
    Dec 2004
    Location
    York, PA
    Posts
    95
    right("00" & rs("chap") + 1, 3)
    Sorry to be terse
    some say it's a curse
    I know it's worse
    I'm just diverse

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Yes as in general to pad with leading 0's up to 3 digits:
    varFld = Right("000" & varFld, 3)
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  4. #4
    Join Date
    Dec 2004
    Location
    York, PA
    Posts
    95
    Why three? you know you are always passing at least one character-- But I'm not going to quibble over it
    Sorry to be terse
    some say it's a curse
    I know it's worse
    I'm just diverse

  5. #5
    Join Date
    Jul 2004
    Posts
    494

    three because

    The maximum number are in 3 digits in the bible (150 chapters in psalms and 176 verses in psalm 119)

Posting Permissions

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