If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to compare text/date between two columns

Started by mark123, 20 Jan 2016 09:01:56 AM

Previous topic - Next topic

mark123

I have a report in which in one data item while writing case statement i need to check two name columns contains same  name or not(condition 1).
Similarly i need to check if date matches between two date columns(condition 2).

I am writing
case
when
(condition 1) and (condition 2)
then

end

Can i directly compare by keeping = between the two columns or is there separate syntax for comparing two text and date columns.

Thanks,
Mark

BigChris

If I'm reading your question correctly (and forgive me if I'm not), you can certainly write a calculation that's along the lines of:

Case
when [Field1] = [Field2] and [Date1] = [Date2] then 'Success'
else 'Failure'
End


You might need to do some fiddling with formats, for example casting the dates if you need to get rid of time elements, or trimming text fields to get rid of trailing spaces.

mark123