Help

Return Date based on another field

Topic Labels: Dates & Timezones
1313 1
cancel
Showing results for 
Search instead for 
Did you mean: 
wrasse
5 - Automation Enthusiast
5 - Automation Enthusiast

So, I have a date column in a table

What I want to do is in another table, if the Tank column reads SPS or Nano, return the earliest date and the latest date. Is there a way to do this? Or do I have to have two separate date columns and roll that up?

1 Reply 1

I’m pretty sure there’s a way to do what you want, but your description and screenshot only covered part of your setup. Is it a case where the date in {Dosing Date SPS} is returned if the {Tank} value is SPS, and a date from a different field is returned if it’s Nano? If so, your setup could look something like this:

Screen Shot 2019-08-16 at 11.14.35 PM.png

The formula in the {Dosing Date} field is this (tweak the timezone setting as needed):

SET_TIMEZONE(
    SWITCH(
        Tank,
        "SPS", {Dosing Date SPS},
        "Nano", {Dosing Date Nano}
    ),
    "America/Chicago"
)

When those records are looked up in another table, the tank and appropriate dosing date can be pulled in via a Lookup field:

48%20PM

You also mentioned something about “the earliest date and the latest date,” which I’m unsure how to interpret, but I hope this points you in the right direction.