=IF(AND(Next Call Put Date < Active Maturity Date, Next Call Put Date <>1/1/2100,IF(Next Knockout Date <>1/1/2100,IF(Next Knockout Date < Next Call Put Date,1,0),1)),1,0)
Any help appreciated - Thanks in advance.
=IF(AND(Next Call Put Date < Active Maturity Date, Next Call Put Date <>1/1/2100,IF(Next Knockout Date <>1/1/2100,IF(Next Knockout Date < Next Call Put Date,1,0),1)),1,0)
Any help appreciated - Thanks in advance.
Last edited by speedo; 07-17-2012 at 10:54 AM.
...so what's the question?
I mean, presumably you want this to iterate somehow--a case statement?--but I have no idea what you want the future state of the logical assessments to be.
First, as Ben mentions, the question is unclear and there is no CASE statement in Excel (there is in VBA, though).
Second, it is not even a case statement. That can all be reduced to:
=--AND(NCPD < AMD, NCPD <>1/1/2100, NKD < NCPD)
A case statement reacts to many different options, but when you can reduce it to 1 or 0, then all you need is an if statement.
Pauley
I want to do convert the following Excel IF statement into an SQL query. Is this possible?
The query is in MS Excel 2007 and yields the correct results:
=IF(AND(Next Call Put Date < Active Maturity Date, Next Call Put Date <>1/1/2100,IF(Next Knockout Date <>1/1/2100,IF(Next Knockout Date < Next Call Put Date,1,0),1)),1,0)
Can this be translated into a SQL statement - all date fields can be assumed as individual database fields. I want to be able to return the same FLAG as per the Excel IF statement.
Thanks
Last edited by speedo; 07-18-2012 at 02:59 AM.
Again, not sure if you need a case statement. Wouldn't something like this work?
DECLARE @myflag bit;
SET @myflag = (NCPD < AMD) AND (NCPD <> '2100-1-1') AND (NKD < NCPD);
Note: I did shorten your names to their 'acronyms'. Also, you may get a better response at an SQL forum.
Pauley
i guess it would be better putting this in a SQL forum.... thanks to all for their help!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks