Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How SQL command queury the first character of a Name column from a MS Access database?

How SQL command queury the first character of a Name column from a MS Access database?

Scheduled Pinned Locked Moved Database
databasehelptutorialquestion
8 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Curious 2009
    wrote on last edited by
    #1

    I have a MS Access database with a table INFO that has Name column (only contains First Name), since it contains a huge list, it will require very long time to queury all of them. I prefer to devide them by character groups (A,B,C ... Z) in order to reduce the queury time I couldn't find the the SQL command that can queury table INFO with column Name starting with A character Anyone know how to do it? Thanks to any help :doh:

    L D 2 Replies Last reply
    0
    • C Curious 2009

      I have a MS Access database with a table INFO that has Name column (only contains First Name), since it contains a huge list, it will require very long time to queury all of them. I prefer to devide them by character groups (A,B,C ... Z) in order to reduce the queury time I couldn't find the the SQL command that can queury table INFO with column Name starting with A character Anyone know how to do it? Thanks to any help :doh:

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      WHERE Name LIKE 'A%' ORDER BY Name should do it as % is the wildcard character :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.


      C 1 Reply Last reply
      0
      • C Curious 2009

        I have a MS Access database with a table INFO that has Name column (only contains First Name), since it contains a huge list, it will require very long time to queury all of them. I prefer to devide them by character groups (A,B,C ... Z) in order to reduce the queury time I couldn't find the the SQL command that can queury table INFO with column Name starting with A character Anyone know how to do it? Thanks to any help :doh:

        D Offline
        D Offline
        David Mujica
        wrote on last edited by
        #3

        Try a select statement like this: select * from INFO where Name like "A*" This will return all rows with column, Name, beginning with the Letter A.

        C 1 Reply Last reply
        0
        • D David Mujica

          Try a select statement like this: select * from INFO where Name like "A*" This will return all rows with column, Name, beginning with the Letter A.

          C Offline
          C Offline
          Curious 2009
          wrote on last edited by
          #4

          It works beautifully Thanks for help :-D :-D :-D

          1 Reply Last reply
          0
          • L Luc Pattyn

            WHERE Name LIKE 'A%' ORDER BY Name should do it as % is the wildcard character :)

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


            I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.


            C Offline
            C Offline
            Curious 2009
            wrote on last edited by
            #5

            I did try 'A%' somehow it doesn't work, but if I try with 'A*' like the latter response then it work! Anyway, thank for help just might be syntax from me :)

            L 1 Reply Last reply
            0
            • C Curious 2009

              I did try 'A%' somehow it doesn't work, but if I try with 'A*' like the latter response then it work! Anyway, thank for help just might be syntax from me :)

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              When I use Microsoft.Jet.OLEDB.4.0 to work with an Access database, it takes % as the wildcard character. :confused:

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.


              R 1 Reply Last reply
              0
              • L Luc Pattyn

                When I use Microsoft.Jet.OLEDB.4.0 to work with an Access database, it takes % as the wildcard character. :confused:

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.


                R Offline
                R Offline
                Roger Wright
                wrote on last edited by
                #7

                It's been a long time since I used Access, but IIRC, a % symbol represented a single arbitrary character, while the * meant any number of characters, much like DOS and the ?/* pair.

                "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                L 1 Reply Last reply
                0
                • R Roger Wright

                  It's been a long time since I used Access, but IIRC, a % symbol represented a single arbitrary character, while the * meant any number of characters, much like DOS and the ?/* pair.

                  "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  Roger Wright wrote:

                  IIRC, a % symbol represented a single arbitrary character

                  Not quite. Apparently there are two standards, one using * the other % for "any string", see here[^]. I have a C#/Access application that works well with % (and not at all with *)but reading that page seems to tell me I should use *, not %. :doh:

                  Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                  I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.


                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups