query question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    query question

    hi,

    How would I query my table to return only the records where the field
    'mobile' has a valid mobile telephone number.

    Valid meaning begining with 07 and being 11 characters in length.

    many thanks,

    Dave


  • Bill Karwin

    #2
    Re: query question

    me@privacy.net wrote:[color=blue]
    > How would I query my table to return only the records where the field
    > 'mobile' has a valid mobile telephone number.
    >
    > Valid meaning begining with 07 and being 11 characters in length.[/color]

    I'd do something like this:

    SELECT ...
    WHERE mobile_number LIKE '07%' AND mobile_number LIKE '___________'
    (that's 11 _ characters)

    Regards,
    Bill K.

    Comment

    • Guest's Avatar

      #3
      Re: query question

      > I'd do something like this:[color=blue]
      >
      > SELECT ...
      > WHERE mobile_number LIKE '07%' AND mobile_number LIKE '___________'
      > (that's 11 _ characters)
      >
      > Regards,
      > Bill K.[/color]



      Thanks Bill, that worked.


      Comment

      • Markus Popp

        #4
        Re: query question

        > SELECT ...[color=blue]
        > WHERE mobile_number LIKE '07%' AND mobile_number LIKE '___________'
        > (that's 11 _ characters)[/color]

        Of course you can combine these two writing

        SELECT ... WHERE mobile_number LIKE '07_________'; (07 and 9 more
        underscores).

        Markus


        Comment

        Working...