Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Convert Excel/Access IF Statement to a Case If Statement

$
0
0

I am completely lost how on how to change an Excel IF Statement into a Case IF Statement. Can anyone help?

Here is my Excel If Statement:  Bascially if the I want to return Y if the data is true and N if false.

IF(“OM ORDER LINE DETAILS”.”FULFILLMENT CODE”="MTS", IF(“- COMMON DATE”.DATE”<=IF(DAYOFWEEK("OM Order Line Details"."Customer Request Date")>4,”OM ORDER LINE DETAILS”.”CUSTOMER REQUEST DATE”+4,”OM ORDER LINE DETAILS”.”CUSTOMER REQUEST DATE”+2),"Y","N"),IF(“-COMMON DATE”.DATE”<= "OM Order Line Details"."Original Promise Date","Y","N"))

This is what I have on my sixth or seventh try:

Case when “OM ORDER LINE DETAILS”.”FULFILLMENT CODE”=’MTS’ Then

(Case when  “- COMMON DATE”.DATE”<= Then

Case when DAYOFWEEK("OM Order Line Details"."Customer Request Date") >4 Then ”OM ORDER LINE DETAILS”.”CUSTOMER REQUEST DATE”+4 Else ”OM ORDER LINE DETAILS”.”CUSTOMER REQUEST DATE”+2 Then ‘Y’ Else ‘N’)

Case When “- COMMON DATE”.DATE”<= "OM Order Line Details"."Original Promise Date" Then ‘Y’ Else ‘N’)End) End


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>