christimess
Programmer
In the report I am creating I need to pull the check date and what the month-to-date(MTD) deduction would be within the month that the check date is in. I am not sure if I am going the “easy” way about this, but I can’t think of another way, so I am open to all suggestions.
The If/Then statement I am trying to create is:
If derived field month = report variable month then derived field deduction amount.
The macro I created looks as follows:
Sub MTD()
If DerivedField (“MONTH”) = GetRepVar(“month”) then DerivedField(“DEDCDEE”)
End if
DerivedField(X)
End Sub
There are two errors in the above statement, but I don’t know what they are.
Is it correct to do this as a macro, or can a derived field be done? I tried to create it as a derived field, but could not get it to work either.
My database platform is Oracle.
Derived Field MONTH is as follows:
TO_CHAR(“DED”.”CHECK_DT”,”MM”)
Derived Field DEDCDEE is as follows:
SUM(DISTINCT CASE “DED”.”AL_DEDCD”
WHEN ‘X’ THEN “DED”.”AL_AMOUNT”
WHEN ‘Y’ THEN “DED”.”AL_AMOUNT”
WHEN ‘Z’ THEN “DED”.”AL_AMOUNT”
ELSE 0
END)
Thanks in advance for your help and Happy New Year Everyone
The If/Then statement I am trying to create is:
If derived field month = report variable month then derived field deduction amount.
The macro I created looks as follows:
Sub MTD()
If DerivedField (“MONTH”) = GetRepVar(“month”) then DerivedField(“DEDCDEE”)
End if
DerivedField(X)
End Sub
There are two errors in the above statement, but I don’t know what they are.
Is it correct to do this as a macro, or can a derived field be done? I tried to create it as a derived field, but could not get it to work either.
My database platform is Oracle.
Derived Field MONTH is as follows:
TO_CHAR(“DED”.”CHECK_DT”,”MM”)
Derived Field DEDCDEE is as follows:
SUM(DISTINCT CASE “DED”.”AL_DEDCD”
WHEN ‘X’ THEN “DED”.”AL_AMOUNT”
WHEN ‘Y’ THEN “DED”.”AL_AMOUNT”
WHEN ‘Z’ THEN “DED”.”AL_AMOUNT”
ELSE 0
END)
Thanks in advance for your help and Happy New Year Everyone