Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100

    Unanswered: date convetion, I want dd-mm-yy

    Hi people,

    I think lot of you have had the same problem as me. I want the user enters the date in a text box as dd-mm-yy, but the date is interpreted by VB and Access like mm-dd-yy. Do you know how can I change this? I mean, when the user enters 07-05-04 is 7th April 2004 and not 5th July 2004.

    Thanks in advance.

  2. #2
    Join Date
    Mar 2004
    Posts
    82
    I don't see why it should. I have several date fields where I have specified the format as Medium Date and the Input mask in the following manner: 99\->L<LL\-00;0;_

    The user sees a field such as this __-__-__ and enters a date in the form 01-Jan-04. Seems to do what you want.

    Jabo

  3. #3
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    You might want to check the regional settings for the computer you are on. In the US mm-dd-yy is the norm, but in most other countries it is dd-yy-yy. I know that the regional settings determine yy or yyyy, regardless of what is entered for the input mask. If I put in a mask for mm/dd/yy and the user enters the data __/__/__ once the data is entered it changes to a four digit year.

    Check the Regional Options of Settings/Control Panel and I think you can default the short date to dd/mm/yy.

  4. #4
    Join Date
    Mar 2004
    Posts
    82
    That's true, but if all that the other person wants is to ensure that data entry is done in the form dd-mm-yy, the mask would force a text specification for the month and obviates any confusion. Irrespective of how the background storage happens, the date would be captured in preferred way. Right?

  5. #5
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100
    Originally posted by Jablonski
    That's true, but if all that the other person wants is to ensure that data entry is done in the form dd-mm-yy, the mask would force a text specification for the month and obviates any confusion. Irrespective of how the background storage happens, the date would be captured in preferred way. Right?
    Ok, I agree in your solution, but I want the users enter the date as 30-07-04. With all numbers, because they are entering a lot of dates and it is more handy and fast to write all numbers than write numbers for the day, then letters for the month, and then numbers for the year.

    I was trying to search in internet about a solution, manuals and stuff like that, but I don't find anything that helps me.

    Any idea?

    Thank you.

  6. #6
    Join Date
    Mar 2004
    Posts
    82
    Interesting you say that - about the need to enter all numbers in dates for faster data entry. In Canada, where date custom varies (between the European or, mm-dd-yy, and American or, dd-mm-yy), there is great scope for error. My own preference is to force the month in text so data entry happens correctly. Sure, this slows down data entry somewhat and users have to get used to it, but the risk is much less.

  7. #7
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14
    Even I have developed an application which had a requirement that the user should be forced to enter the date in dd/mm/yy format. To remove any sort of dependency with the regional setting and other settings in the database, we followed this procedure.

    1) IF you r storing the date in DB, then make the data type of the field as text.
    2) Next, while validating the record, use the MID function to read DD, then MM and then YY, the starting point and length of the string to read depends on the format that is agreed with the user. Validate the MM between 1 and 12, DD between 1 and 31. and convert the this string to DD-MMM-YY format.
    3) Now validate the DD-MMM-YY using Cdate function, which will take care of leap year and similar stuff.
    4) Store the date in DD-MMM-yy format, but while showing, change it to dd-mm-yy or whatever you want.

    This is slightly lengthy, but it works without any hazzle of regional setting.

  8. #8
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100
    Thanks a lot guys,

    By the mean time I solved it by means of 3 text boxes (one for the day, other for the month and another for the year). I tell in the interface what is for each text box (month and day specially). Then I build the date with SerialDate and I store it in the DB as Date.

    Thank you, nobody was answering me for one day, thank you for replies.

    Pipeio

  9. #9
    Join Date
    Nov 2003
    Location
    San Francisco, CA USA
    Posts
    59
    Be careful relying on this entirely though, because this doesn't solve the 03/05/04 problem. Is it March 5th or May 3rd?

    Hmmmmm......

    Originally posted by aqua_zinc
    2) Next, while validating the record, use the MID function to read DD, then MM and then YY, the starting point and length of the string to read depends on the format that is agreed with the user. Validate the MM between 1 and 12, DD between 1 and 31. and convert the this string to DD-MMM-YY format.

  10. #10
    Join Date
    Nov 2003
    Posts
    1,487
    Supplying a date is probably one of the worst items to enter for data entry. Therefore, it is far more convenient for the user to interact with a date interface such as a Calendar Control. The date is just a double-click away.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •