Thanks, Karen and Tony. You've shown it CAN work with a simple operator.
It does appear that, within a more complex construct, the syntax of the
condition in the first IFF statement resolves correctly no matter how
one attacks it; whilst the nested IFF statement fails, no matter its
construction.
My experience of R:BASE on the whole is that failure is most likely of
my own doing; so I'll submit this question to Support.
Regarding Karen's question, this produces the intended update:
UPDATE fts_input_tt +
SET trxQuarter = +
(IFF('trxMonth IN (1,2,3)','Q1', +
(IFEQ(trxMonth,'4','Q2','XX'))))
... as does this:
SET VAR vhumptyQ1 TEXT = ('''trxMonth IN (1,2,3)''')
UPDATE fts_input_tt +
SET trxQuarter = +
(IFF(&vhumptyQ1,'Q1', +
(IFEQ(trxMonth,'4','Q2','XX'))))
But this construction:
SET VAR vhumptyQ1 TEXT = ('''trxMonth IN (1,2,3)''')
SET VAR vhumptyQ2 TEXT = ('''trxMonth IN (4,5,6)''')
UPDATE fts_input_tt +
SET trxQuarter = +
(IFF(&vhumptyQ1,'Q1', +
(IFF(&vhumptyQ2,'Q2','XX'))))
... returns the same error:
Parentheses required around the list of items for the IN clause. (2304)
Thanks Karen, Tony.
Bruce A. Chitiea | SafeSectors, Inc.
112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
[email protected] | +011 (909) 238-9012 c | +011 (909) 912-8678 f
------ Original Message ------
From: "Tony Luck" <[email protected]>
To: [email protected]
Sent: 6/16/2021 2:00:57 PM
Subject: Re: [RBASE-L] - IFF Function Quandry
I tried a simple nesting of the IFF as I have nested IFEQ IFLT ect
before. This worked
SET VAR v1 INTEGER = 1
SET VAR v2 INTEGER = 2
SET VAR v3 INTEGER = 3
SET VAR v4 = (IFF('.v1>.v2','1',(IFF('.v3<.v1','2','3'))))
RETURN
I've yet to try with an IN statement though
On Thu, Jun 17, 2021 at 6:18 AM 'Karen Tellef' via RBASE-L
<[email protected]> wrote:
Do we know for sure that you can nest IFF statements? I've never
tried it. Maybe test first by replacing the second IFF with a simple
"IFEQ" statement just to test if that works
Karen
-----Original Message-----
From: Bruce Chitiea <[email protected]>
To: [email protected] <[email protected]>
Sent: Wed, Jun 16, 2021 3:15 pm
Subject: [RBASE-L] - IFF Function Quandry
RBGX5E Current (Best viewed in monospaced font)
The trxMonth and trxQuarter columns are each defined as TEXT (2).
This statement:
UPDATE fts_input_tt +
SET trxQuarter = +
(IFF('trxMonth IN (1,2,3)','Q1','xx'))
... correctly updates trxQuarter with value Q1 where the value of
trxMonth is in (1,2,3) and with 'xx' for all other values of trxMonth.
This statement:
UPDATE fts_input_tt +
SET trxQuarter = +
(IFF('trxMonth IN (1,2,3)','Q1', +
(IFF('trxMonth IN (4,5,6)','Q2','XX'))))
... returns the error:
Parentheses required around the list of items for the IN clause.
(2304)
... and aborts the UPDATE.
???
Thanks for your assistance
Bruce A. Chitiea | SafeSectors, Inc.
112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
[email protected] | +011 (909) 238-9012 c | +011 (909) 912-8678 f
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google
Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/em64238e39-bec5-4762-8c3e-79ad6040a5f5%40pathfinder
<https://groups.google.com/d/msgid/rbase-l/em64238e39-bec5-4762-8c3e-79ad6040a5f5%40pathfinder?utm_medium=email&utm_source=footer>.
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google
Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/143382711.676998.1623874722191%40mail.yahoo.com
<https://groups.google.com/d/msgid/rbase-l/143382711.676998.1623874722191%40mail.yahoo.com?utm_medium=email&utm_source=footer>.
--
Regards
Tony
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google
Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/CABnhDARvPtKjK8fiyDdy%3DxYF0BxApX%3DVc_L_UHK4%3DRSodz7QBQ%40mail.gmail.com
<https://groups.google.com/d/msgid/rbase-l/CABnhDARvPtKjK8fiyDdy%3DxYF0BxApX%3DVc_L_UHK4%3DRSodz7QBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/emdc452d56-cf8f-4c7e-8e80-4254449c4bf9%40pathfinder.