Re: Custom Date Format
Tom, I have a similar issue as Bruce had in that I would like to have my date stored as YYYY-MM-DD in the date field (date_rev).
On my form, I have an object button (not sure how I stumbled across this) that inputs the current date into the date field.
Using the " -events -on push" , feature for this object button and this code, the format gets changed on the form to what I want
Date_String = date_format(DATE() , "yyyy-MM-dd")
parentform: date_rev.value = date_string
When I look at the date_rev field of the table, it is stored as MM/DD/YYYY. If you put your cursor in the field on the form, it will revert to mm/dd/yyyy.
The issue I am having with this is that I want to automatically attach this date to a file name that is generated from some of the fields on the form layout when I save the report as a pdf file.
I have been able to overcome this by creating a 10 character field (date_rev2) and then adding this code
parentform: date_rev2.value = date_string
to the same object button that formats the current date as YYYY-MM-DD.
I prefer the YYYY-MMM-DD format as this sorts better when you use explorer to view the saved reports and the /// can not be used in a file name.
I was wondering if I was overlooking some way to do this in the A5 setup without having to add the extra field and code as you mentioned the dates were stored as yyy/mm/dd
Larry Ternowski
Tom, I have a similar issue as Bruce had in that I would like to have my date stored as YYYY-MM-DD in the date field (date_rev).
On my form, I have an object button (not sure how I stumbled across this) that inputs the current date into the date field.
Using the " -events -on push" , feature for this object button and this code, the format gets changed on the form to what I want
Date_String = date_format(DATE() , "yyyy-MM-dd")
parentform: date_rev.value = date_string
When I look at the date_rev field of the table, it is stored as MM/DD/YYYY. If you put your cursor in the field on the form, it will revert to mm/dd/yyyy.
The issue I am having with this is that I want to automatically attach this date to a file name that is generated from some of the fields on the form layout when I save the report as a pdf file.
I have been able to overcome this by creating a 10 character field (date_rev2) and then adding this code
parentform: date_rev2.value = date_string
to the same object button that formats the current date as YYYY-MM-DD.
I prefer the YYYY-MMM-DD format as this sorts better when you use explorer to view the saved reports and the /// can not be used in a file name.
I was wondering if I was overlooking some way to do this in the A5 setup without having to add the extra field and code as you mentioned the dates were stored as yyy/mm/dd
Larry Ternowski
Comment