Results 1 to 5 of 5
  1. #1
    Draconius is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    5

    Would like date year to be entered as 12 or 2012 to return 2012 always

    I have a date field that is a short date format, have Date() as default value, and the input mask as 99/99/9900;0;" " so theoretically I could enter "7/27/12" OR "7/27/2012" and both should come out as 7/27/2012, but if you enter 2 digits for the year, it won't allow. It MUST have all 4 digits of the year be typed in. I would like the ability to do both.



    Any assistance on this?

  2. #2
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    use your own mask. then caste the string value as a date when you need it. that's always an option. why not that?

    by the way, for numeric placeholders in acc, 9's are optionals and 0's are mandatories. if you did know that, try using "0099" instead of "9900" and see what the program tells you about your programming ignorance.

    e.g. => if it doesn't yell at you, maybe you can use it!!

  3. #3
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    or hey, another thing you could do is just purposely truncate the date when you need it outputted in pre-formatted objects, like reports. obviously the function would always be: RIGHT(datevalue, 2).

  4. #4
    Draconius is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    5
    Quote Originally Posted by help_me_with_access View Post
    use your own mask. then caste the string value as a date when you need it. that's always an option. why not that?

    by the way, for numeric placeholders in acc, 9's are optionals and 0's are mandatories. if you did know that, try using "0099" instead of "9900" and see what the program tells you about your programming ignorance.

    e.g. => if it doesn't yell at you, maybe you can use it!!
    0099 worked! Of course, I could probably go so far as make it all 9's to allow someone to just enter 7/27 and it return 7/27/2012.

    THANKS!!!

  5. #5
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    sure thing. happiness achieve in this thread. wooohooo!

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

Similar Threads

  1. Replies: 1
    Last Post: 07-11-2012, 07:16 PM
  2. Access Query Issue with 2012 dates
    By gtrudel in forum Access
    Replies: 2
    Last Post: 04-16-2012, 05:35 PM
  3. Replies: 4
    Last Post: 01-10-2012, 06:26 PM
  4. Replies: 1
    Last Post: 12-12-2011, 06:32 AM
  5. Replies: 1
    Last Post: 12-09-2005, 10:29 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