Results 1 to 6 of 6

Thread: Help me

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    6

    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
    alex

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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.

  3. #3
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057

    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.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    6

    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
    alex

  5. #5
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    6
    anymore help????
    alex

Posting Permissions

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



Click Here to Expand Forum to Full Width