+ Reply to Thread
Results 1 to 3 of 3

How to delete record based on date?

  1. #1
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    297

    How to delete record based on date?

    For example: I have a table UserTable , which has two fields: UserID and LastActivateDate

    I would like to delete records which has not activated for two years.

    I have other questions in below red part. I am new to Access VBA, so my code only shows what I would like to do, it may be wrong.

    Thanks.

    Please Login or Register  to view this content.
    Last edited by VAer; 09-24-2020 at 09:12 PM.

  2. #2
    Valued Forum Contributor vba_php's Avatar
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    1,232

    Re: How to delete record based on date?

    you can do it any number of ways. look up the functions:

    => dlookup()
    => datediff()
    => dateadd()
    => date()

    https://support.microsoft.com/en-us/...b-bed10dca5937

    https://docs.microsoft.com/en-us/off.../date-function

    https://docs.microsoft.com/en-us/off...ediff-function

    https://docs.microsoft.com/en-us/off...teadd-function

    if you are deleting users though, you should be storing all sorts of identifying info about them. login dates, names, dates, passwords that are HASHED, etc...
    -Adam (please don't call me "sir"!)

  3. #3
    Registered User
    Join Date
    10-06-2020
    Location
    Cologne, Germany
    MS-Off Ver
    Microsoft Office 2020
    Posts
    7

    Re: How to delete record based on date?

    I was just looking for this information. vba_php thank you for shared information. I have a big sheet of data and some of records must be deleted according ot some parametres.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] When record is created/deleted in Table1, then add/delete record to Table2
    By michellepace in forum Excel General
    Replies: 1
    Last Post: 11-26-2015, 04:45 AM
  2. Delete Duplicate records but keep 1 record with most recent date
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-07-2015, 02:28 AM
  3. [SOLVED] Delete rows on sheet based on last record on column
    By ACALEX in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-19-2014, 06:19 AM
  4. Insert/Delete record in Sheet2 based on cell value in Sheet1
    By nseethar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2014, 02:29 AM
  5. Delete Row based on record found in cell
    By capnhud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2012, 09:04 AM
  6. [SOLVED] Delete record(s) in other cells based on value of one cell.
    By MPope in forum Excel General
    Replies: 1
    Last Post: 10-12-2005, 02:05 PM
  7. [SOLVED] delete record based on a value
    By Anauna in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2005, 04:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1