Results 1 to 3 of 3

Thread: Report Help

  1. #1
    sudan
    Guest

    Report Help

    I am working in report, which group data by county. I need to write a code to do that: count the record in each group and if it has only one record then don

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Report Help

    Hi Ali,
    I suspect your simplest solution is to use two queries. The first query simply counts the entries per county. The second query then uses your original table and the first query as its data source (linked by county) with a calculated expression in it something like:
    CountyGroup: iif(query2.countofcounty>1,table1.county,"Other")
    This will effectively choose the county name for counties with more than one entry and "Other" for counties with one entry.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    sudan
    Guest

    Re: Report Help

    Thanks for the help Roy

Posting Permissions

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