How SQL command queury the first character of a Name column from a MS Access database?
-
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:
-
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:
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.
-
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:
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.
-
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.
It works beautifully Thanks for help :-D :-D :-D
-
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.
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 :)
-
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 :)
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.
-
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.
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"
-
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"
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.