Hi, for the life of me I have no idea why the formula below isn't working. I have 11 'Stages'. Each one on its own in its own formula does what I need - flag '1' if the date is over 1990.
However, when I combine them into a single formula, the formula returns zero. Not all dates will have values. I have CR (10) set to return default values for null fields.
I think there's a formatting issue somewhere, but can't spot it. Can anyone help me?
The formula:
// Stage 01
local numbervar Stage01;
if {@Current WIP S01} > 0 and {dtblDMA0001Jobs.D_S1_Ready_To_Schedule} > date(1990,01,01) then Stage01:= 1;
// Stage 02
local numbervar Stage02;
if {@Current WIP S02} > 0 and {dtblDMA0001Jobs.D_S2_Ready_To_Schedule} > date(1990,01,01) then Stage02:= 1;
// Stage 03
local numbervar Stage03;
if {@Current WIP S01} > 0 and {dtblDMA0001Jobs.D_S3_Ready_To_Schedule} > date(1990,01,01) then Stage03:= 1;
// Stage 04
local numbervar Stage04;
if {@Current WIP S04} > 0 and {dtblDMA0001Jobs.D_S4_Ready_To_Schedule} > date(1990,01,01) then Stage04:= 1;
// Stage 05
local numbervar Stage05;
if {@Current WIP S05} > 0 and {dtblDMA0001Jobs.D_S5_Ready_To_Schedule} > date(1990,01,01) then Stage05:= 1;
// Stage 06
local numbervar Stage06;
if {@Current WIP S06} > 0 and {dtblDMA0001Jobs.D_S6_Ready_To_Schedule} > date(1990,01,01) then Stage06:= 1;
// Stage 07
local numbervar Stage07;
if {@Current WIP S07} > 0 and {dtblDMA0001Jobs.D_S7_Ready_To_Schedule} > date(1990,01,01) then Stage07:= 1;
// Stage 08
local numbervar Stage08;
if {@Current WIP S08} > 0 and {dtblDMA0001Jobs.D_S8_Ready_To_Schedule} > date(1990,01,01) then Stage08:= 1;
// Stage 09
local numbervar Stage09;
if {@Current WIP S09} > 0 and {dtblDMA0001Jobs.D_S9_Ready_To_Schedule} > date(1990,01,01) then Stage09:= 1;
// Stage 10
local numbervar Stage10;
if {@Current WIP S10} > 0 and {dtblDMA0001Jobs.D_S10_Ready_To_Schedule} > date(1990,01,01) then Stage10:= 1;
// Stage 11
local numbervar Stage11;
if {@Current WIP S11} > 0 and {dtblDMA0001Jobs.D_S11_Ready_To_Schedule} > date(1990,01,01) then Stage11:= 1;
// Add Them All Up
Stage01 + Stage02 + Stage03 + Stage04 + Stage05 + Stage06 + Stage07 + Stage08 + Stage09 + Stage10 + Stage11;
However, when I combine them into a single formula, the formula returns zero. Not all dates will have values. I have CR (10) set to return default values for null fields.
I think there's a formatting issue somewhere, but can't spot it. Can anyone help me?
The formula:
// Stage 01
local numbervar Stage01;
if {@Current WIP S01} > 0 and {dtblDMA0001Jobs.D_S1_Ready_To_Schedule} > date(1990,01,01) then Stage01:= 1;
// Stage 02
local numbervar Stage02;
if {@Current WIP S02} > 0 and {dtblDMA0001Jobs.D_S2_Ready_To_Schedule} > date(1990,01,01) then Stage02:= 1;
// Stage 03
local numbervar Stage03;
if {@Current WIP S01} > 0 and {dtblDMA0001Jobs.D_S3_Ready_To_Schedule} > date(1990,01,01) then Stage03:= 1;
// Stage 04
local numbervar Stage04;
if {@Current WIP S04} > 0 and {dtblDMA0001Jobs.D_S4_Ready_To_Schedule} > date(1990,01,01) then Stage04:= 1;
// Stage 05
local numbervar Stage05;
if {@Current WIP S05} > 0 and {dtblDMA0001Jobs.D_S5_Ready_To_Schedule} > date(1990,01,01) then Stage05:= 1;
// Stage 06
local numbervar Stage06;
if {@Current WIP S06} > 0 and {dtblDMA0001Jobs.D_S6_Ready_To_Schedule} > date(1990,01,01) then Stage06:= 1;
// Stage 07
local numbervar Stage07;
if {@Current WIP S07} > 0 and {dtblDMA0001Jobs.D_S7_Ready_To_Schedule} > date(1990,01,01) then Stage07:= 1;
// Stage 08
local numbervar Stage08;
if {@Current WIP S08} > 0 and {dtblDMA0001Jobs.D_S8_Ready_To_Schedule} > date(1990,01,01) then Stage08:= 1;
// Stage 09
local numbervar Stage09;
if {@Current WIP S09} > 0 and {dtblDMA0001Jobs.D_S9_Ready_To_Schedule} > date(1990,01,01) then Stage09:= 1;
// Stage 10
local numbervar Stage10;
if {@Current WIP S10} > 0 and {dtblDMA0001Jobs.D_S10_Ready_To_Schedule} > date(1990,01,01) then Stage10:= 1;
// Stage 11
local numbervar Stage11;
if {@Current WIP S11} > 0 and {dtblDMA0001Jobs.D_S11_Ready_To_Schedule} > date(1990,01,01) then Stage11:= 1;
// Add Them All Up
Stage01 + Stage02 + Stage03 + Stage04 + Stage05 + Stage06 + Stage07 + Stage08 + Stage09 + Stage10 + Stage11;