Town (5) - how to pull this out of database/recordset?

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Town (5) - how to pull this out of database/recordset?

    Hi.

    Access/VBScript/ASP

    I have a table of records. Each record has a "town" field. Some of the
    records are from the same town.

    How do I:

    1) Group the towns, in order to display a town list on the site:

    Aberdeen
    Edinburgh
    Glasgow

    2) Incorporate the "total number of matching records" into this list for
    each town, like so:

    Aberdeen (2)
    Edinburgh (4)
    Glasgow (3)

    Hope someone can help. Thanks.

    Nath.


    Nathon Jones Guest

  2. Similar Questions and Discussions

    1. Using SPRY to pull from database and auto rotate
      I am trying to create an effect for a client site where their current news will be 'scrolled' with page by page transitions on the home page. I am...
    2. Is it possible to pull pages of html from database?
      I have a number of articles that I have applied a css sheet to. I have close to twenty articles. Each article has a couple of pictures - headings...
    3. pull text from a database or file with html in it
      Is it possible to pull html from a database a have the page dynamically eg <h3>hello</h3> <p>bbbbbbbbbbbbbbbbbbbbbbb</p> etc then when...
    4. dynamic pull-down based on another pull-down
      Greetings, is there a tech doc somewhere to show: 1) 2 pull-downs, dynamically loaded from two record sets. first is "State" and next is "City"...
    5. Unable to save recordset into an access database
      Hi I am trying to make a page where i simply collect data from a form and update it in the database. i am useing a recodset to do the above. The...
  3. #2

    Default Re: Town (5) - how to pull this out of database/recordset?

    Nathon

    Try the following:

    SELECT TblAddress.City, Count(TblAddress.City) AS CountOfCity
    FROM TblAddress
    GROUP BY TblAddress.City
    ORDER BY TblAddress.City

    Brendan

    "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
    news:d0sb6f$6sh$1@forums.macromedia.com...
    > Hi.
    >
    > Access/VBScript/ASP
    >
    > I have a table of records. Each record has a "town" field. Some of the
    > records are from the same town.
    >
    > How do I:
    >
    > 1) Group the towns, in order to display a town list on the site:
    >
    > Aberdeen
    > Edinburgh
    > Glasgow
    >
    > 2) Incorporate the "total number of matching records" into this list for
    > each town, like so:
    >
    > Aberdeen (2)
    > Edinburgh (4)
    > Glasgow (3)
    >
    > Hope someone can help. Thanks.
    >
    > Nath.
    >
    >

    Singularity.co.uk Guest

  4. #3

    Default Re: Town (5) - how to pull this out of database/recordset?

    You'd have

    select town,count(town) as towncount from mytable group by town

    For more on the basics of SQL see

    [url]www.sqlcourse.com[/url]
    [url]http://www.w3schools.com/sql/default.asp[/url]

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  5. #4

    Default Re: Town (5) - how to pull this out of database/recordset?

    Supoib!

    Nath. :))

    "Singularity.co.uk" <Brendan.Collins@RemoveThisSingularity.co.uk> wrote in
    message news:d0sbgv$7he$1@forums.macromedia.com...
    > Nathon
    >
    > Try the following:
    >
    > SELECT TblAddress.City, Count(TblAddress.City) AS CountOfCity
    > FROM TblAddress
    > GROUP BY TblAddress.City
    > ORDER BY TblAddress.City
    >
    > Brendan
    >
    > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
    > news:d0sb6f$6sh$1@forums.macromedia.com...
    >> Hi.
    >>
    >> Access/VBScript/ASP
    >>
    >> I have a table of records. Each record has a "town" field. Some of the
    >> records are from the same town.
    >>
    >> How do I:
    >>
    >> 1) Group the towns, in order to display a town list on the site:
    >>
    >> Aberdeen
    >> Edinburgh
    >> Glasgow
    >>
    >> 2) Incorporate the "total number of matching records" into this list for
    >> each town, like so:
    >>
    >> Aberdeen (2)
    >> Edinburgh (4)
    >> Glasgow (3)
    >>
    >> Hope someone can help. Thanks.
    >>
    >> Nath.
    >>
    >>
    >
    >

    Nathon Jones Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139