Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have data and i need to apply different values based on date.
I have the date format as '2014-06-07 17:02' i have used
Dual(Month(DATE_TIME) & '-' & Date(DATE_TIME, 'YY'), Num(Year(DATE_TIME)) & Num(Month(DATE_TIME), '00')) AS MonthYear,
to get monthyear.
then i need to apply one value till 'MAY-14' and another value after 'MAY-14'
i have used
=if((MonthYear < 'May-14' ), 'true' , 'yyy')
then for if Monthyear = 'JUNE-14 ' it display 'true' and may it show 'yyy'.
This is wrong. because 'JUNE-14' > May-14
please help me to solve this problem
You're comparing strings. A word starting with a J is considered smaller than a word starting with an M. You need to compare numeric values instead. You can do that by creating dates from your strings.
=if((date#(MonthYear,'MMM-YY') < date#('May-14','MMM-YY'), 'true' , 'yyy')
It doesn't work , pls see attached qvw
Hi,
look at the attached application.
Regards
ASHFAQ
HI
Try like this
=if(Date#(MonthYear,'MMM-YY') > date#('May-14','MMM-YY'), 'true' , 'yyy')