Results 1 to 4 of 4
  1. #1
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60

    COunt after date

    I thought this would be easy to get, but realizing I still dont know so much.

    I have two tables. Table 1 has CVD_Equipment, and a date. Each record would be a new run, and I have another table (table two) that has the CVD_Equipment, and a date.

    In making a query, there I can count the occurrences of the CVD equipment, however, I want to count only after the date thats in table 2.

    In the criteria in the query, I added this but it does not work.

    count(if([Table1].[date]>[Table2].[date],1,0))



    This did not work. Please help

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    is there only 1 record in table 2?
    if so:
    in the query pull in both tables, do not join
    show the fields from tbl1
    and under tbl1.date ,put the criteria: >tbl2.date

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Maybe try this:

    CVD_Count:Sum(Iif([Table1].[date]>[Table2].[date],1,0))

    In the query you would join the two tables by CVD_Equipment field.

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60
    Thank You!

    I left joined CVD_Equipment, and

    Days since rebuld: Sum(IIf([Table1].[Date]>[Table2].[Date],1,0))

    I didn't consider making it one entry on table2. I will change that to just keep updating that record. I will have the historical data saved by a update to another table.

    Thank you for your help.

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

Similar Threads

  1. Count btw date
    By mavisyew in forum Queries
    Replies: 8
    Last Post: 09-02-2014, 01:04 AM
  2. Count how many days since and on what date
    By burrina in forum Queries
    Replies: 28
    Last Post: 01-26-2013, 11:57 AM
  3. Filter by date and then count
    By mosheva in forum Queries
    Replies: 4
    Last Post: 09-13-2012, 10:27 AM
  4. not count date fields if the same
    By Icky_Joe in forum Queries
    Replies: 2
    Last Post: 04-11-2012, 12:55 PM
  5. Count records since date
    By sotssax in forum Queries
    Replies: 10
    Last Post: 03-07-2012, 07:30 PM

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