|
-
Aug 7th, 2002, 10:47 AM
#1
Thread Starter
New Member
Help me
I have a request number which is made up of a 4 digit sheet number and then a 2 digits that represent the location.
I want to query a database on the 2 digits representing the location to retrieve a textual representtion of the number. Anyway I could do this
Sir Stupidhead
-
Aug 7th, 2002, 11:10 AM
#2
How is the number formatted? An example please.
If the two digits you are looking for are the last two, or the first two, it would be a snap to parse them out of the six digit string.
-
Aug 7th, 2002, 11:17 AM
#3
Frenzied Member
Not sure if I fully understand the question but...
If the #'s are at the end of the request number:
SELECT * FROM thetable WHERE requestnumber LIKE '%15'
If the #'s are at the begining of the request number:
SELECT * FROM thetable WHERE requestnumber LIKE '15%'
If the #'s are in the middle of the request number:
SELECT * FROM thetable WHERE requestnumber LIKE '%15%'
Hope that helped 
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Aug 7th, 2002, 11:22 AM
#4
Thread Starter
New Member
i see
Ok the number is at the end ie.....................5656 for the sheet number and 12 for the location. This number is entered together onto a form as 565612. I want to be able to take the last 2 digits i.e 12 and query a table for the location name been represeted by the digit 12 and store this in another txtbox.
hope this makes it easier
thanks for your help
-
Aug 7th, 2002, 11:51 AM
#5
Frenzied Member
What I posted should work or if you want to make it more exact and you know it will always be a 6 digit number with the last two being the ones you want you can do it like this:
SELECT * FROM thetable WHERE requestnumber LIKE '____15'
(thats 4 underscores "_ _ _ _" w/o the spaces)
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Aug 7th, 2002, 02:43 PM
#6
Thread Starter
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|