function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sryansryan 

Forula Field for calculating Day Shift and Night Shift from Date/Time Fields

I would appreciate any ideas of suggestions for writing a Fomula that looks at two fields (Date/Time Fields) and then sets a Text value (maybe  a Case statement) of "Day Shift" or "Night Shift" as follows:

Day Shift = 6 am to 6 pm (with same day)
Night Shift = 6 pm to 6am (across 2 days)

Thanks in advance for any ideas about ways to do this.

Sean
Ashish_SFDCAshish_SFDC
Hi Syran, 


Please post the exact requirement - there should be a way possible by getting the fields into the Formulas. 


Regards,
Ashish
AgiAgi
Hi,

this is checking if start date end date are on the same day,

If( Datevalue(Shift_Start__c)=Datevalue(Shift_End__c), "Day Shift", "Night Shift")