Results 1 to 4 of 4
  1. #1
    George is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    295

    How to obtain a Date type with out the time attached

    Good Day.

    I have a field [CurrentDay] of type Date/Time. The values for this field are entered through the selection from the date picker. However the time of the day always come along with the date - even if it is not seen. This creates a huge problem when making a query based on this field because no results will be returned unless the time is included with the date in the criteria.



    The other part to the problem is that I cannot find a built in function in the expression builder to generate the current date without appending the time - now() certainly does not do that - even if the time is not seen it is there.

    Are they answers to these problems?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Try applying the Int function to the date value, e.g. Int(now()). Date values are stored as numeric real numbers, with the integer portion being the date, and the decimal portion being the time, so int(datevalue) gives you only the date.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Further to John_G's response, you should become familiar with techonthenet, a great site for Access functions -syntax and examples.

    Date Now

    Good luck with your project.

  4. #4
    George is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    295
    Thanks John_G's it is working fine

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

Similar Threads

  1. Replies: 11
    Last Post: 07-20-2014, 06:22 PM
  2. Replies: 1
    Last Post: 01-22-2014, 03:45 PM
  3. Cannot set validation rule on Date/Time type
    By intheflesh77 in forum Access
    Replies: 2
    Last Post: 10-12-2013, 08:57 AM
  4. Replies: 1
    Last Post: 08-07-2011, 07:58 AM
  5. Replies: 5
    Last Post: 07-18-2011, 06:07 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