Results 1 to 3 of 3
  1. #1
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199

    Help with function to abbreviate a Date/Time field.

    Hello,



    I have Date/Time Field data like this:
    9/22/2014 6:20:05 PM
    . I'm trying to convert that into a field in my query so that the output would be this: 9/2014. Could anyone help with the formula?

    Thanks,

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    what you are seeing is a formatted view of the value which will be something like 41904.7639467593. The value to the left of the dp represents the date, and the value to the right the time expressed as a percentage of the number of seconds in the day. To format as you want in a query for example try

    format(myDate,"m/yyyy")

    or in the control of a form or report, set the relevant control format property to m/yyyy

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Try

    Format(FieldName, "m/yyyy")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 6
    Last Post: 11-10-2014, 03:14 AM
  2. Replies: 7
    Last Post: 09-02-2014, 08:18 AM
  3. Subtracting a date/time field from a number to get date/time
    By Lifeseeker1019 in forum Programming
    Replies: 4
    Last Post: 03-28-2014, 12:59 PM
  4. Replies: 5
    Last Post: 03-19-2014, 02:31 PM
  5. Replies: 5
    Last Post: 04-26-2012, 05:25 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