Recordset Help

  • I have a table containing postcodes, cities and counties

    I need to produce a recordset thats lists the distinct counties and all the cities

    ie

    West Midlands (Birmingham, Solihull, Salford, etc)

    South Glamorgan (Cardiff, Newport, Cwmbran, etc)

    HELP

  • Please read and follow the first link in my signature.

    Providing ready to use table DDL, sample data, expected result and what you've tried so far is the best way to get fast answers, usually even with tested code.

    Otherwise you might get something like: Please search BOL (BooksOnLine, the SQL Server help system usually installed together with SQL Server) for

    SELECT GROUP BY. 😉



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • If you have the Counties and Cities in the same table, you need to look at the database design. Very poor design.

    You need to place the County and the City names each in a separate table.

    Andrew SQLDBA

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply