Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 8743 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

This topic is 8743 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.