Results 1 to 3 of 3
  1. #1
    PuJo is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    2

    Report question.

    Afternoon all,
    I am trying to generate a report based off a query. The query works fine and the report is working correct.
    I really don't know what kind of report this is called, but I will do my best to explain what I am trying to do.
    Example:
    If I keep track of 10 different tennis clubs, and everyday I list the total number of visitors visit each facility.
    At the end of the month I want to make the report for each location. All I can get now is an entry for each time a visitor was logged into the system.
    So at the end of the month, I would like the visitors to be totaled and listed under only one heading. Location XYZ 687 for the month.
    I hope I explained it correctly.
    Thanks,


    Pujo

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    what does your table look like? what are the fields?

  3. #3
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742

    Yeah, Specifics would be nice...

    It would be really quick to answer this if you posted the design of the tables, as rpeare asked. The SQL of the query that is working would also help.

    I'm going to create you a quick fake query based on two made-up tables. You said you have an entry for each time a visitor was logged into the system. I'm going to assume that those visits are logged by each club, and have a date-timestamp, which may or may not have the exact time on it.
    Code:
    tblVisits
      VisitID
      ClubID
      VisitTime
    
    tblClub
      ClubID
      ClubName
    Here's a query that will calculate your visitors for each month for each club.
    Code:
    SELECT  Month(TV.VisitTime), TC.ClubName, Count(TV.VisitID)
    FROM tblClubs AS TC, tblVisits AS TV
    WHERE TC.ClubID = TV.ClubID
    GROUP BY Month(TV.VisitTime), TC.ClubName
    You could also add lines after the WHERE clause to limit the reported data to the prior month or to a limited date range
    Code:
    limit to prior month:
    AND Month(TV.VisitTime) = Month(DateAdd("M",-1,Date))
    AND Year(TV.VisitTime) = Year(DateAdd("M",-1,Date))
    
    limit to prior three months:
    AND TV.VisitTime >= DateSerial(Year(Date),Month(date)-3,1)
    AND TV.VisitTime < DateSerial(Year(Date),Month(date),1)
    This query should provide a Sum Report listing something like this
    Code:
    03   Club Bazanga     127
    03   Club Chartreuse  412
    03   Club Nowhere      12
    ...
    04   Club Bazanga     222
    04   Club Chartreuse  112
    04   Club Nowhere       3
    ...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report Question
    By hkimpact in forum Access
    Replies: 1
    Last Post: 06-13-2012, 04:14 PM
  2. Question about report
    By NoAlarms in forum Access
    Replies: 13
    Last Post: 04-12-2012, 12:02 PM
  3. Report Question, Need Help
    By manic in forum Reports
    Replies: 3
    Last Post: 03-26-2012, 06:46 PM
  4. Replies: 1
    Last Post: 02-02-2009, 05:52 AM
  5. Question on a report
    By Xena11 in forum Reports
    Replies: 2
    Last Post: 11-17-2006, 12:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums