Results 1 to 2 of 2
  1. #1
    vianda is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    6

    Counting records every 5 days

    Hi, I posted earlier to number dates from 1 to 5 which is working well. Now I need to number the records for each five dates group. I wonder if it is possible to do it at the same time I number the dates, or I need a new query?
    the code for earlier query is:

    SELECT yt.*, (((SELECT COUNT(DateField) FROM (SELECT DISTINCT Datefield FROM UNITSbyDATE) dc WHERE dc.DateField <= yt.DateField)-1) Mod 5)+1 AS DateNo
    FROM UNITSbyDATE AS yt;

    the query should look like this:



    Provider'sName Child'sName DateField Units DateNo Rank
    Jane Smith HITZGES, AYLA 6/1/2016 1 1 1
    Jane Smith BREEN, FIONA 6/1/2016 1 1 2
    Jane Smith Grundner Jayden 6/1/2016 1 1 3
    Jane Smith WILDING, CONNOR 6/2/2016 1 2 4
    Jane Smith CLINTON, BROOKLYN 6/2/2016 1 2 5
    Jane Smith BREEN, FIONA 6/3/2016 1 3 6
    Jane Smith PLETO, LANDON 6/3/2016 1 3 7
    Jane Smith WILDING, CONNOR 6/3/2016 1 3 8
    Jane Smith Boos Ethan 6/6/2016 1 4 9
    Jane Smith BREEN, FIONA 6/6/2016 1 4 10
    Jane Smith HITZGES, AYLA 6/6/2016 1 4 11
    Jane Smith Grundner Jayden 6/6/2016 1 4 12
    Jane Smith RICE, GRADY 6/6/2016 1 4 13
    Jane Smith WILDING, CONNOR 6/6/2016 1 4 14
    Jane Smith Gross Oliver 6/6/2016 1 4 15
    Jane Smith Melton Garrett 6/7/2016 1 5 16
    Jane Smith DEARING, KAYLEE 6/7/2016 1 5 17
    Jane Smith DEARING, KAYLEE 6/7/2016 1 5 18
    Jane Smith CLINTON, BROOKLYN 6/7/2016 1 5 19
    Jane Smith HITZGES, AYLA 6/7/2016 1 5 20
    Jane Smith WILDING, CONNOR 6/7/2016 1 5 21
    Jane Smith Grundner Jayden 6/8/2016 1 1 1
    Jane Smith HITZGES, AYLA 6/8/2016 1 1 2
    Jane Smith RICE, GRADY 6/8/2016 1 1 3
    Jane Smith BREEN, FIONA 6/8/2016 1 1 4
    Jane Smith HITZGES, AYLA 6/8/2016 1 1 5
    Jane Smith DEARING, KAYLEE 6/9/2016 1 2 6
    Jane Smith Grundner Jayden 6/9/2016 1 2 7
    Jane Smith Boos Ethan 6/9/2016 1 2 8
    Jane Smith BREEN, FIONA 6/10/2016 1 3 9
    Jane Smith WILDING, CONNOR 6/10/2016 1 3 10
    Jane Smith HITZGES, AYLA 6/13/2016 1 4 11
    Jane Smith Gross Oliver 6/13/2016 1 4 12
    Jane Smith Grundner Jayden 6/13/2016 1 4 13
    Jane Smith BREEN, FIONA 6/13/2016 1 4 14
    Jane Smith Boos Ethan 6/13/2016 1 4 15
    Jane Smith RICE, GRADY 6/13/2016 1 4 16

    Thank you

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,931
    you don't have sufficient data to be able to do that. The only difference between the first two records is the childs name - so you could sort alphabetically, but the second group is in a different alphabetical order

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

Similar Threads

  1. Replies: 9
    Last Post: 03-07-2016, 04:17 PM
  2. Counting Number of Days (not records) in a Month
    By Tomfernandez1 in forum Reports
    Replies: 10
    Last Post: 01-29-2014, 02:54 PM
  3. Counting Days of the Week
    By losingmymind in forum Reports
    Replies: 10
    Last Post: 12-23-2013, 03:30 PM
  4. How Counting Active Days?
    By harapan in forum Queries
    Replies: 9
    Last Post: 04-02-2012, 10:19 PM
  5. counting days
    By d3pl0y3d in forum Access
    Replies: 13
    Last Post: 04-28-2011, 06:31 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