Results 1 to 3 of 3
  1. #1
    tomClark is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2009
    Posts
    8

    sql statement to find if records were not added

    I have an sql statement in access to find records > 1



    3 fields ID, name, and Date.
    I use this statement to find if duplicate records were added.
    SELECT ID,COUNT(name)AS CNT
    FROM Table1
    WHERE (((Table1.Date)=[Enter Date]
    GROUP BY ID
    HAVING COUNT(name)>1;

    now I want to find records < 1 ( records not added)
    there are 30 records added each week- is there anyway to search and find if any were not entered - without physically looking at report.
    thank you

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Try
    Code:
    dim rs as recordset
    dim SQL 
    as string
    sql
    ="SELECT ID, COUNT(name)AS CNT _
          FROM Table1 _
          WHERE (((Table1.Date)=[Enter Date] _
          GROUP BY ID _
          HAVING COUNT(name)<" 
    1
    set rs
    =currentdb.openrecordset(SQL,dbopensnapshot)
    if 
    rs.recordcount <1 then
      
    'no records added
      '
    do something
    end 
    if 

  3. #3
    tomClark is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2009
    Posts
    8
    thanks I will try that

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

Similar Threads

  1. Replies: 1
    Last Post: 01-22-2010, 03:21 AM
  2. Find Records Query
    By sullyman in forum Programming
    Replies: 1
    Last Post: 10-28-2009, 08:49 AM
  3. Find Missing Records
    By Flanders in forum Queries
    Replies: 6
    Last Post: 06-24-2009, 07:02 AM
  4. Replies: 4
    Last Post: 01-29-2009, 02:43 AM
  5. Added items in a column.
    By Wrangler in forum Forms
    Replies: 3
    Last Post: 03-25-2006, 07:56 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