Results 1 to 6 of 6
  1. #1
    enfapro7 is offline Novice
    Windows 8 Access 2016
    Join Date
    Oct 2016
    Posts
    3

    delete records from datevalue criteria

    Dear,



    i have a problem to delete records from datevalue criteria, i want to delete a whole date but access only delete a date with 0:00 time
    DELETE *
    FROM KPI_NMS_1
    WHERE [Start Time] =DateValue('10/1/2016');
    Click image for larger version. 

Name:	Tables.JPG 
Views:	5 
Size:	67.9 KB 
ID:	26014

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Where are you getting the value for your criteria from? You need to pass the time as well as the date. Depending on your regional settings and how/where you get the criteria, this might be something like.
    10/1/2016 0:0:0 AM

  3. #3
    enfapro7 is offline Novice
    Windows 8 Access 2016
    Join Date
    Oct 2016
    Posts
    3
    Quote Originally Posted by ItsMe View Post
    Where are you getting the value for your criteria from? You need to pass the time as well as the date. Depending on your regional settings and how/where you get the criteria, this might be something like.
    10/1/2016 0:0:0 AM
    thanks,

    can i use today() criteria on that table and data type like that?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    When I look at the screenshot of your table, it seems the data stored was relevant only to the date and not the time. When Access does this, the time is midnight (10/1/2016 0:0:0 AM).

    If you use a built in Access function to retrieve the System Date, you will retrieve the Date with the time of midnight. This might be what you are after.

    To retrieve the computer's system Date use the Date() function. You can type Date() into the criteria of the Query Designer.

  5. #5
    enfapro7 is offline Novice
    Windows 8 Access 2016
    Join Date
    Oct 2016
    Posts
    3
    Quote Originally Posted by ItsMe View Post
    When I look at the screenshot of your table, it seems the data stored was relevant only to the date and not the time. When Access does this, the time is midnight (10/1/2016 0:0:0 AM).

    If you use a built in Access function to retrieve the System Date, you will retrieve the Date with the time of midnight. This might be what you are after.

    To retrieve the computer's system Date use the Date() function. You can type Date() into the criteria of the Query Designer.
    Dear ItsMe,

    many many thanks its help me a lot

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Glad to hear.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-07-2015, 11:33 AM
  2. delete duplicate records based on multiple criteria
    By sfgiantsdude in forum Access
    Replies: 1
    Last Post: 09-21-2015, 01:22 PM
  3. Replies: 6
    Last Post: 06-24-2014, 10:09 PM
  4. Delete Duplicate Records Based on Criteria
    By chadd in forum Queries
    Replies: 2
    Last Post: 02-07-2012, 04:24 PM
  5. Replies: 5
    Last Post: 01-24-2012, 06:19 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