+ Start a Discussion
RRESRRES 

Determine if Day Of The Week Field is equal to Current day of the week.

Hey Everyone,

I have created 2 formula fields. One field called Today determines the current day of the week (monday, tuesday, etc...), the other field called Run Day will evaluate if the Today field is equal to a picklist field called Delivery Day. If so it will say Production Run Today, if not No Production Run Today.

For some reason the 2nd formula field doesnt seem to work correctly. Can anyone help out? My code is below:

IF(ISPICKVAL(Delivery_Day__c,Today__c),"Production Run Today", "No Production Run Today")


Thanks,
Rich
Michael SnowMichael Snow
I believe that IsPickVal can only compare a picklist to a string literal.  Therefore, you would need to do:

IF(And(ISPICKVAL(Delivery_Day__c,"Monday"),Today__c="Monday"),"Production Run Today",
  IF(And(ISPICKVAL(Delivery_Day__c,"Tuesday"),Today__c="Tuesday"),"Production Run Today",
    IF(And(ISPICKVAL(Delivery_Day__c,"Wednesday"),Today__c="Wednesday"),"Production Run Today",
      IF(And(ISPICKVAL(Delivery_Day__c,"Thursday"),Today__c="Thursday"),"Production Run Today",
        IF(And(ISPICKVAL(Delivery_Day__c,"Friday"),Today__c="Friday"),"Production Run Today","No Production Run Today")))))