Results 1 to 3 of 3
  1. #1
    drewetzel is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34

    format date as integer

    Hi,



    I want to make a field in which the date is represented in this format, yyyy_mm, but I want to be able to sort on the field and have it list the months in order.

    So far I know of the format and datepart functions, but both return a text value. Does anyone know of a way to do this that returns an integer value?

    Thanks,
    Andrew

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    To sort on it you can create a field

    MySortField:Val(Format([DateFieldHere], "yyyymm"))

    And then sort on that.

  3. #3
    drewetzel is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34
    that worked! Thanks a lot

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

Similar Threads

  1. Date field not in date format
    By Lorlai in forum Access
    Replies: 11
    Last Post: 06-27-2011, 05:14 PM
  2. Date Format
    By lonewolfwfk in forum Programming
    Replies: 4
    Last Post: 11-25-2010, 09:00 PM
  3. Adding column as INTEGER makes it a long integer?
    By luckycharms in forum Programming
    Replies: 2
    Last Post: 10-20-2010, 02:47 PM
  4. date format
    By dollygg in forum Access
    Replies: 2
    Last Post: 01-19-2010, 10:14 AM
  5. Date Format
    By St3ph3n in forum Access
    Replies: 4
    Last Post: 03-09-2006, 11:23 AM

Tags for this Thread

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