Results 1 to 6 of 6
  1. #1
    nayan is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2019
    Posts
    2

    Question How to add minutes with current time in table

    I want to add time with current time. It will be based on Minutes field. Result will be in Expire field.


    Code:
    =DateAdd("n",20,Time())
    is working fine. But
    Code:
    =DateAdd("n",[Minutes],Time())
    make an error.


    Click image for larger version. 

Name:	1.JPG 
Views:	17 
Size:	20.8 KB 
ID:	39684

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Instead of separately recording Data and Time, investigate the intrinsic Now function in Access.

    Good luck and welcome to the forum.

  3. #3
    nayan is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2019
    Posts
    2
    Actually i am new in access. Could you plz give me some true step to solve this problem? I just want to store calculated time in Expire field.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Best practices would suggest you do NOT store calculated values. You use a query to determine Expire whenever needed.

    If you use the Now function, as suggested, that will give Date and Time in a single field. You can then use your DateAdd function to determine/calculate Expire.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    @Nayan

    for your education, time is actually stored as a decimal number (now is 43717.6309953704), the bit before the decimal point represents the number of days since 31/12/1899 and the bit after, the time expressed as the time in seconds since midnight divided by the number of seconds in the day (86400).

    Suggest you google 'time datatype' to find out more.

    edit: taken out alternative calc as irrelevant


  6. #6
    Uncle Gizmo is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    26
    You might find that this video provides some inspiration or possibly perspiration!

    https://youtu.be/D_magBM3rOY

    Sent from my Pixel 3a using Tapatalk
    Last edited by Uncle Gizmo; 09-10-2019 at 03:59 AM.

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

Similar Threads

  1. Replies: 11
    Last Post: 12-12-2016, 12:00 PM
  2. Replies: 2
    Last Post: 07-23-2015, 07:12 AM
  3. Replies: 12
    Last Post: 07-19-2015, 05:21 PM
  4. Replies: 4
    Last Post: 04-04-2015, 03:28 AM
  5. Replies: 1
    Last Post: 02-28-2012, 09:16 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