Results 1 to 5 of 5
  1. #1
    jagrok is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2014
    Posts
    19

    Counting Dates with skipped information

    Dear All
    I`m new one which are trying to do something in ms Access.
    I`m just learning this language, but its not easy and this is reason for looking possibility to count some rows in my table. I have a table with some Columns like: Names Costs Quantity Date This date is date of 1st month sales. There are thousands of products. This tables has 45.000 queries

    its looks
    its looks
    HTML Code:
    Name      Costs  Quantity   Date
    ProductA  1250   45         01/03/2011
    ProductA  1250   23         01/06/2011
    ProductB  750    31         01/02/2011
    ProductB  750    45         01/09/2011
    ProductB  750    21         01/12/2011
    ProductB  750    45         01/01/2012
    ProductB  750    37         01/03/2012
    ProductB  750    25         01/06/2013
    ProductB  750    11         01/07/2014
    ProductB  750    15         01/09/2014
    I would like to build queries which will be able to count Date and continue counting after 1st month of the sales, the next count will count not visible information and only will show counting Cycle for the some of specified information.
    I will give a name for this column like "Month Live"
    It will be look like that after this queries/question like that
    HTML Code:
    Name      Costs  Quantity   Date         Month Live
    ProductA  1250   45         01/03/2011   1
    ProductA  1250   23         01/06/2011   4
    ProductB  750    31         01/02/2011   1
    ProductB  750    45         01/09/2011   8
    ProductB  750    21         01/12/2011   11
    ProductB  750    45         01/01/2012   12
    ProductB  750    37         01/03/2012   14
    ProductB  750    25         01/06/2013   29
    ProductB  750    11         01/07/2014   41
    ProductB  750    15         01/09/2014   43
    How to execute to get the result like this one ?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Thought I understand the MonthLive calc until the jumps from 14 to 29 and 29 to 41. That's where I get lost.

    Regardless, I expect what you want won't be easy.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jagrok is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2014
    Posts
    19
    Quote Originally Posted by June7 View Post
    Thought I understand the MonthLive calc until the jumps from 14 to 29 and 29 to 41. That's where I get lost.

    Regardless, I expect what you want won't be easy.
    Why you were lost ?
    Look for month and year

    14 month is the month which was calculated from the first notification/first date

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Okay, get it now.

    Are you showing dates in dd/mm/yyyy structure? That is not U.S./Access standard (mm/dd/yyyy). Review: http://allenbrowne.com/ser-36.html

    I work with U.S. dates.

    One way to do what you want:

    SELECT Table1.*, CDate(DMin("[Date]","Table1","[Name]='" & [Name] & "'")) AS MinDate, DateDiff("m",[MinDate],[Date])+1 AS MonthLive FROM Table1;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    jagrok is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2014
    Posts
    19
    Perfect Job.
    It`s looks that i want to do it as you wrote

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

Similar Threads

  1. Replies: 4
    Last Post: 10-08-2011, 06:31 AM
  2. DCount only counting some dates
    By Jules48 in forum Programming
    Replies: 7
    Last Post: 09-22-2011, 02:29 AM
  3. Counting Active Records Between 2 Dates
    By catat in forum Queries
    Replies: 5
    Last Post: 07-28-2010, 10:55 AM
  4. Counting Dates
    By JenBouchard in forum Access
    Replies: 1
    Last Post: 01-22-2010, 05:08 PM
  5. Replies: 4
    Last Post: 08-27-2009, 01:21 AM

Tags for this Thread

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