I'm trying to do a "simple" case statement to make two fields(Last Name and DOB) in my output show blank for a specific Member ID.
Here is the one that works....
CASE
WHEN [Report Query].[MEMBER ID] = 12345
then ' '
else
[Report Query].[LAST NAME]
end
[MEMBER ID] is an integer
[LAST NAME] is a string
Here is the one that won't work:
CASE
WHEN [Report Query].[MEMBER ID] = 12345
then ' '
else
[Report Query].[DOB]
end
[MEMBER ID] is Integer
[DOB] is dateTime
I googled and found that I have to cast and ive tried casting both fields to VARCHAR(10) and other formats without any luck. Anybody have any input? Can I do the casting right in the statement or do I cast the data item first then use that in the CASE statement? If anybody can send along how the statement should look that would be great. FYI - I didnt have to CAST either field in the first example TO blank out LAST NAME.
if ( PRODUCT_LINE_CODE = 991)
then ('')
else ( cast (PRODUCT_LINE_CODE, varchar(4) ))
Maybe something like this?
Quote from: bus_pass_man on Yesterday at 05:53:45 PMif ( PRODUCT_LINE_CODE = 991)
then ('')
else ( cast (PRODUCT_LINE_CODE, varchar(4) ))
Maybe something like this?
Quote from: bus_pass_man on Yesterday at 05:53:45 PMif ( PRODUCT_LINE_CODE = 991)
then ('')
else ( cast (PRODUCT_LINE_CODE, varchar(4) ))
Maybe something like this?
That was easy!!! Thanks!!! I appreciate you