Welcome to SPN

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

Sign Up Now!

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.
    > >
    > >

    >
    >
    >
     

Share This Page