Case when and formula with date

Options
EChampagne
EChampagne Member
edited November 2024 in SQL DataFlows

I'm writing the following formula and it's not distinguishing between the dates correctly. What am I doing wrong?

case

when `Parent OR AgencyName` = 'Aspire Home Healthcare' and `Date` >= '10/23/2024' then `Total referrals` = 0

ELSE `Total referrals`

end

Note, my date shows as the little calendar and 'Total referrals' column is "abc" format.

Tagged:

Best Answer

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    On your top condition you are returning `Total referrals `=0. If you want it to be 0 in this condition then just return 0


    case 

    when `Parent OR AgencyName` = 'Aspire Home Healthcare' and `Date` >= '10/23/2024' then 0 

    ELSE `Total referrals`

    end

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    On your top condition you are returning `Total referrals `=0. If you want it to be 0 in this condition then just return 0


    case 

    when `Parent OR AgencyName` = 'Aspire Home Healthcare' and `Date` >= '10/23/2024' then 0 

    ELSE `Total referrals`

    end

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**