Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Pulling from a database starting with one letter?

Discussion in 'Information Technology' started by UKSBD, Jul 28, 2006.

  1. UKSBD

    UKSBD
    Expand Collapse
    Guest

    Hi,
    I'm trying to sort a directory alphabetically using ASP
    How can I pull from the database but just pull out
    categories starting with one letter?
    At the moment I am just using

    ORDER BY strCategory ASC

    Which pulls them all and lists alphabetically,
    but how do I just pull all categories starting with A?
    and then a separate one pulling categories starting
    with B, etc. etc.

    Many thanks.
     
  2. Loading...

    Similar Threads Forum Date
    USA NSA has massive database of Americans' phone calls (USA Today 5.11.2006) Breaking News Jun 11, 2013
    Some database errors while navigating SPN forums Announcements Dec 29, 2004

  3. Peter Danes

    Peter Danes
    Expand Collapse
    Guest

    Add a WHERE clause?

    WHERE LEFT(strCategory,1)="A"

    Pete



    "UKSBD" <UKSBD@discussions.microsoft.com> pí¹e v diskusním pøíspìvku
    news:A2B95EC7-7E4C-4A48-BBEA-E5799DF8EFA1@microsoft.com...
    > Hi,
    > I'm trying to sort a directory alphabetically using ASP
    > How can I pull from the database but just pull out
    > categories starting with one letter?
    > At the moment I am just using
    >
    > ORDER BY strCategory ASC
    >
    > Which pulls them all and lists alphabetically,
    > but how do I just pull all categories starting with A?
    > and then a separate one pulling categories starting
    > with B, etc. etc.
    >
    > Many thanks.
    >
    >
     
  4. Arvin Meyer [MVP]

    Arvin Meyer [MVP]
    Expand Collapse
    Guest

    Use a where clause with the "like" keyword:

    WHERE [Field Name] Like "A*"

    using asp and html, you'll need to use a % sign in place of the asterisk.
    --
    Arvin Meyer, MCP, MVP
    Microsoft Access
    Free Access downloads
    http://www.datastrat.com
    http://www.mvps.org/access

    "UKSBD" <UKSBD@discussions.microsoft.com> wrote in message
    news:A2B95EC7-7E4C-4A48-BBEA-E5799DF8EFA1@microsoft.com...
    > Hi,
    > I'm trying to sort a directory alphabetically using ASP
    > How can I pull from the database but just pull out
    > categories starting with one letter?
    > At the moment I am just using
    >
    > ORDER BY strCategory ASC
    >
    > Which pulls them all and lists alphabetically,
    > but how do I just pull all categories starting with A?
    > and then a separate one pulling categories starting
    > with B, etc. etc.
    >
    > Many thanks.
    >
    >
     
  5. UKSBD

    UKSBD
    Expand Collapse
    Guest

    Thank you, that was exactly what I wanted.
    I also see I can also pull out individual categories in the same way.
    Going to be very useful for me.

    Thanks again.


    "Arvin Meyer [MVP]" wrote:

    > Use a where clause with the "like" keyword:
    >
    > WHERE [Field Name] Like "A*"
    >
    > using asp and html, you'll need to use a % sign in place of the asterisk.
    > --
    > Arvin Meyer, MCP, MVP
    > Microsoft Access
    > Free Access downloads
    > http://www.datastrat.com
    > http://www.mvps.org/access
    >
    > "UKSBD" <UKSBD@discussions.microsoft.com> wrote in message
    > news:A2B95EC7-7E4C-4A48-BBEA-E5799DF8EFA1@microsoft.com...
    > > Hi,
    > > I'm trying to sort a directory alphabetically using ASP
    > > How can I pull from the database but just pull out
    > > categories starting with one letter?
    > > At the moment I am just using
    > >
    > > ORDER BY strCategory ASC
    > >
    > > Which pulls them all and lists alphabetically,
    > > but how do I just pull all categories starting with A?
    > > and then a separate one pulling categories starting
    > > with B, etc. etc.
    > >
    > > Many thanks.
    > >
    > >

    >
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page