If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > paging 001+001=002 <> 2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-14-05, 23:05
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
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?
Reply With Quote
  #2 (permalink)  
Old 02-15-05, 09:45
White Knight White Knight is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 02-17-05, 02:21
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
  #4 (permalink)  
Old 02-18-05, 10:11
White Knight White Knight is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 02-18-05, 19:08
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
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)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On