To format your date display, use the Data section of the Inspector in layout mode.
Let ( [
todaysDate = Get ( CurrentDate ) ;
todaysYear = Year ( todaysDate ) ;
todaysMonth = Month ( todaysDate ) ;
todaysDay = Day ( todaysDate )
todaysYear & "-" & Right ( "0" & todaysMonth ; 2 ) & "-" & Right ( "0" & todaysDay ; 2 )
* Edit: erolst is correct if all you want to do is change how the date is displayed (as opposed to changing the actual data in the field).
Thank you Mike. It works excellent. Thank you to erolst.
tom, I like to use
Right ( "00" & Day(date) ; 2 )
rather than the single "0". I do genealogy, pedigree tracking and all sorts of thing where a given Day (or even Month) is unknown. If it's a text:
then it sorts as I want it and it can be "parsed" easily enough. Yes, probably not a "valid" date to FMP, but you need that "text" for reports often.
So, even where I need valid dates, I still use the "00" just for consistency throughout all my solutions and FMP doesn't squawk!