Jump to content

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

Recommended Posts

Posted

Hi

I have a specific enddate and endtime. what I would like to do is show the time remaining in one field. For example if there are 2 days left is will say 2, however if there is less that 1 day left it should show the hours and minutes left. I can do this as separate calculations, but can't figure out a way to show this in the same field, since they result in different calculation types (date or time). Is there a way of doing this. or is it impossible due to the different calculation result formats?

Thanks

Posted

FM has functions called DateToText and TimeToText. Your final calc should be set to result in text. This is a very quick untested reply, but something like:

case(

EndDate < Status(CurrentDate), "the end date has passed",

EndDate = Status(CurrentDate), TimeToText(put your time calc here),

DateToText(put your date calc here) & " days"

)

Hope that helps a bit. smile.gif

cheers,

Wendy

Posted

Thanks for the tip. Here is what worked for me:

TimeLeft=Case(EndDate > Status(CurrentDate), DaysLeft & " days", EndTimeEST > Status(CurrentTime),TimeToText(HoursLeft), "Ended")

Posted

Here is a slightly modified version with more accurate output:

TimeLeft=Case(DaysLeft = "1", DaysLeft & " day", EndDate > Status(CurrentDate), DaysLeft & " days", EndTimeEST > Status(CurrentTime),TimeToText(HoursLeft), "Ended")

This topic is 7795 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.