Results 1 to 5 of 5
  1. #1
    Join Date
    May 2005
    Posts
    11

    Unanswered: Select Specific Data Pattern ~

    Dear All,

    Need some advice on this. Currently I need to select some specific data pattern in Access. Please advice on this :

    Field Name : EmpId
    Field Length : int (6)

    Eg: the data is 111001, 111011, 111021, 111031

    How to select all the employee ID where the 5th digit is '0' ? like '####0#',

    Thanks
    - no LIFE no INFO -

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'm pretty certain you need to use the wildcard masks in the like clause in SQL

    eg
    select blah, blah1... blahx form mytable where blahy like "????0*";


    HTH

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    Your hashes\ pound signs (forgot to check your location) are fine but you can't do a pattern search on an integer. You'll need to convert the data to string first - check out CStr.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You could use Mid() as well.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    In fact, it sounds like this column shouldn't really be Integer data type anyway. It might be worth a ponder oin whether this column should be text.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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