Results 1 to 6 of 6
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Modifying dates

    I am interested in using some date queries and I need some guidance. It seems that one must put in criteria
    such as 12/1/2016 and 6/10/2016.

    Now I am interested in finding a equivalent for the present data. That could be 5/19/2016 or it could be something else.

    Please note that the present day will not 5/19/2016 it will be 5/20/2016. That means it is, of course, always changing.

    So instead of putting in an actual date is there some other way that I can represent the present.

    Any help appreciated. Thanks in advance.



    Respectfully


    Lou_Reed

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Use the Date() function to represent the current date.

    The format of the returned string is affected by your regional settings (set in Control Panel); on my PC for example the Date() function yields 19/05/2016.

  3. #3
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Yes, that seems to work. Thank you very much.

    Respectfully,

    Lou_Reed

  4. #4
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Can I use Date(0) and date(0)-n or Date(0)+n in queries?

    Respectfully,

    Lou_Reed
    Last edited by Lou_Reed; 05-19-2016 at 11:21 AM. Reason: correction

  5. #5
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I have a list of personnel for one column and a column of dates beside the name such 06/30/2016. This indicates the date of expiration of a license or permit that they each have.

    Now what I want to create an additional list with the word expired (when the date fall before the Date(0) or current when the date falls after the Date() and then expiring soon when the date is current but falls within
    three of the expiration date.


    However, I want to say. "expired", "current" or "expiring" soon. I am not sure how to do that. I mean I can figure out the queries for each category, but to get it to actually say "expired" or whatever is another matter.

    Any help appreciated. Thanks in advance.

    Respectfully,


    Lou Reed

  6. #6
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Can I use Date(0) and date(0)-n or Date(0)+n in queries?
    No. Putting any parameter at all in the Date function will generate an error.

    Use the DateAdd function to add or subtract values from dates.

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

Similar Threads

  1. help! need help modifying a query
    By BigDan in forum Access
    Replies: 16
    Last Post: 05-28-2013, 03:58 PM
  2. Need help modifying query
    By redwagontoy in forum Queries
    Replies: 13
    Last Post: 04-30-2013, 03:25 PM
  3. Modifying a function
    By sjs94704 in forum Programming
    Replies: 5
    Last Post: 12-10-2012, 02:10 PM
  4. Modifying form design in VBA
    By aytee111 in forum Programming
    Replies: 4
    Last Post: 02-17-2012, 02:38 PM
  5. Modifying a database
    By simba in forum Access
    Replies: 0
    Last Post: 06-15-2011, 11:32 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