Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004

    Unanswered: Determining right wildcard pattern

    Greetings all,

    I have a text column field that holds Employee IDs. I need to find the right wildcard pattern that will return all Employee IDs with just all zeroes. For this client, there are no Employee Ids with 4 or less leading zeroes, but only five leading zeroes or more. Below I thought this like command text would work:

    nrv.FIELD_VALUE like '%00000%'.

    It must mostly works but, I am also getting values like 'AN000008'. How do I change the above wildcard text to just reflect the leading zeroes? Any help would be appreciated.


    Patrick Quinn

    TQ3 Navigant Sybase database administrator

  2. #2
    Join Date
    Sep 2002
    Sydney, Australia

    Since you are not a newbie, I will assume you have RTFM, and the same for EFTS if you are using that.

    But the question begs in my mind: if you are going to be performing this kind of operation, why not use an ordinary char (not varchar, not text) column with EmployeeId, rather than store it (somewhere in the) text column, and then have to search for it ?!?

    Derek Asirvadem
    Senior Sybase DBA/Information Architect derekATsoftwaregemsDOTcomDOTau
    Anything worth doing is worth doing Right The First Time
    Spend your money on standards-compliant development or spend 10 times more fixing it

  3. #3
    Join Date
    May 2005
    South Africa
    Provided Answers: 1

    Find leading chars

    nrv.FIELD_VALUE like '00000%'

Posting Permissions

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