February 22, 200124 yr This topic originated in "Left Brain" (at http://www.fmforums.com/ubb/Forum45/HTML/000148.html) but seems more appropriate at this point to be here in CDML. I hope I'm not messing up by cross posting... Does anyone know for sure if Status(CurrentDate) will update automatically when called from a format file in an instance such as this: <IMG SRC="[FMP-Field: Absolute_URL]"> Where I want the image to change daily and the field Date is a calculation that returns a text date and a path to the image for the day using this field Date_Today to determine the day: LeftWords(DateToText(Status(CurrentDate)), 1) & MiddleWords(DateToText(Status(CurrentDate)), 2, 1) & RightWords(DateToText(Status(CurrentDate)), 1) This gives me a date such as 2222001 which I then append a .gif to (with a field called gFileExtension) and put the rest of the absolute URL in using a field called gServer like so: gServer & "/" & RightWords(DateToText(Status(CurrentDate)), 1) & "/" & MonthName(Status(CurrentDate)) & "/" & Date_Today & gFileExtension This returns a result (an absolute path name to the image) in the format file essentially like this that should change on a day to day basis: <IMG SRC="http://www.servername.com/February/2222001.gif"> So, ultimately does this reliably and accurately return the correct date from that original Status(CurrentDate) calculation? Cael.
February 23, 200124 yr A couple of things as I come across them: the calculation for the datename of the image: what is 1112001 - the November 1 or January 11? I'd change the algorithm to put in leading zeros: 01112001 this will make it much easier to read and parse. Actually a better algorithm for the date number thing would be: Day(Status(CurrentDate)) & Month(Status(CurrentDate)) & Year(Status(CurrentDate)) for a calc that included the leading zeros: Case(Day(Status(CurrentDate)) < 10, "0") & Day(Status(CurrentDate)) & Case(Month(Status(CurrentDate)) < 10, "0") & Month(Status(CurrentDate)) & Year(Status(CurrentDate)) I'd maybe suggest that it be put into the format yyymmdd since this sorts much nicer.
Create an account or sign in to comment