Results 1 to 2 of 2
  1. #1
    Fermats1980 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    1

    Date & Repetition Query


    Hi. I am trying to run a query that will show me if a particular serial number has been duplicated within a specific timeframe. So, for example, if a serial number 123 occured in December 2012, I want to try and confirm if it occured within say two months of that date (plus or minus). Just to add some difficulty to the mix; I have experience with Access, but none with SQL (but can obviously cut & paste). Thank you in advance.

  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,771
    Try:

    SELECT *, DCount("SerNum","tablename","SerNum='" & [SerNum] & "' AND [datefield] Between #" & [datefield]-60 & "# And #" & [datefield]+60 & "#") As CountSN FROM tablename;
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 05-09-2013, 09:13 AM
  2. Replies: 25
    Last Post: 11-16-2012, 12:47 PM
  3. Replies: 3
    Last Post: 09-19-2012, 08:59 AM
  4. Replies: 3
    Last Post: 08-21-2012, 03:05 PM
  5. Repetition of data
    By Cedarguy in forum Access
    Replies: 9
    Last Post: 06-06-2012, 07:38 AM

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