Welcome! Log In Create A New Profile

Advanced

Date formatting issues ...

Posted by Dan M 
Dan M
Date formatting issues ...
June 18, 2009 08:46AM
Can someone point me in the right direction date formatting ...

I know it has something to do with the INPUT MASK and RETURN VALUE but I am not seeing where I am going wrong.

The data file/table is MySQL so standard format is YYYY-MM-DD

I would to display as MM/DD/YY (basic American)

When I enter 06/10/09 it saves as 2009-01-00 in the MySQL table and when I open the form up again it displays as __/10/09

Any help is appreciated ...

Dan
Al
Re: Date formatting issues ...
June 18, 2009 11:30AM
Hello Dan

I have not dealt with MySQL but in the Hyper Files the standard return mask is yyyymmdd. If the return mask is left at "As Is" then you will often see problems like you are reporting.

In terms of the display mask on the form you can nominate a mask MM/DD/YY or let it default to the "Date Defined by Project" if you use that mask then check the settings in the Project description > Languages section

Regards
Al
I am using MySQL as a database. Dates are stored as YYYY-MM-DD.

What should I be using for the Input Mask and Returned Value and where do I need to make sure it is correct?

such as ...
1. Analysis > Table > Date field > Parameters of the control Linked to the selected item

2. In the control on each screen > Desctiption of the control

Other than in the Analysis and the Description of the control ... Is there any where else I need to make sure the date formatting is correct?
Jimbo
Re: Date formatting issues ... Still trying ...
June 21, 2009 06:42PM
Hm, did you change the display format of the date in the control ?????
Dan
Re: Date formatting issues ...
June 21, 2009 07:09PM
I believe so ... (in WinDev12)

I did this by going to the actual form, then right click on the control , and there you see Input Mask & Returned Value.

Is that what you mean?

I am using MM/DD/YY in the Input Mask and YYYYMMDD in the returned value.

I thought I should use YYYY-MM-DD in the Returned value (since that is the format in the MySQL table) but that seems to give odd results including mixed up numbers, blanks in the date, etc ...

When I changed the returned value to YYYYMMDD and the MM/DD/YY then I was at least displaying the same date that was stored in the MySQL table to the table and form as MM/DD?YY. BUT when I attempt to modify the date in the form by entering 06/23/09 it will not allow. As I type 06/23/09, 06 is fine, when I type 23 it displays 02/3 the 3 being in the year section so it looks like 06/02/3 I can then change the 3 to 09 but I cannot enter 23 in the middle section for the day.

I can type 01 thru 12 in the middle section.

I think I am confused on the "returned value" part what am I supposedto have there ?? Because where the display shows the correct date 05/12/09 and then I type over the it with 06/23/09 it seems to be accepting input of the month field where I think the day should go ??

When I read the help screen I don't think I am getting what I am supposed put in the Returned Vlaue field??
Dan M
Re: Date formatting issues ...
June 22, 2009 12:22AM
Well after several hours of trying many combinations of the two different date formats I have identified what works but have no understanding of why or the logic behind it ...

All I can say is this works ...

If you are using MySQL as your database which stores dates as YYYY-MM-DD (example 2009-06-21) then you should use:

YYYYMMDD as your Returned Value (this needs to be set in the Analysis > Table > Parameters & the window control > Description

Then, set what ever format you want for how it displays in the Input Mask

I am using MM/DD/YY to display as 06/21/09

Hope this save someone else the many hours it took me to figure it out!
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: