Results 1 to 6 of 6
  1. #1
    sup3rsgt is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2015
    Posts
    3

    Using Now() In Access

    Hi,



    I have imported an Excel Workbook in Access

    In the spreadsheet was a formula to say how old an object is (=(NOW()-$L122)/365)

    I was wondering if there was a way of replicating that in Access, and match to each object in the Database

    Regards
    Toby

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    yes , but to calc the time (in days, d), use DateDiff("d",dateOfObj,Now())
    (or hours h, or seconds, s....)
    but what do you call an object? You use it on data.

  3. #3
    sup3rsgt is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2015
    Posts
    3
    By Object I mean an Item in the Database so in this case a Server.

    How would i apply that? would it be as an expression?

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    yes, use it as an expression in a query or or form on a field.

    (objects are something different in access and excel.)

  5. #5
    sup3rsgt is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2015
    Posts
    3
    Thanks for the help got that working now.

    One more question is there any way or adding colour similar to conditional formatting?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Textbox and combobox controls have Conditional Formatting. Can be found on the ribbon Format tab when form or report in design view.
    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.

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