wilpitz
asked on
Crystal Reports automatically selecting previous business day for a report
I have a report that we are going to be putting on a server to automate it. Currently we have a prompt the user select the previous business day but on the server we need it to automatically select the previous business day. I don't know if this will help but below is the select expert formula I have now.
({FUND_MASTER_IDX.SNAPSHOT _ID}="DEFA ULT" or Isnull({FUND_MASTER_IDX.SN APSHOT_ID} )) and
{ENTITY_GROUP.ENTITY_NAME} in ["MFunds_01_Domestic Eq", "MFunds_02_Global Intl Rgnl", "MFunds_03_Sector", "MFunds_04_Fixed Inc", "MFunds_05_FOF", "MFunds_06_VI", "MFunds_07_Closed-End"] and
({FUND_SUMMARY_IDX.DMART_C URRENCY}=" BASE" or
Isnull({FUND_SUMMARY_IDX.D MART_CURRE NCY})) and
({FUND_MASTER_IDX.EFFECTIV E_DATE} = {?As of Date} or
Isnull({FUND_MASTER_IDX.EF FECTIVE_DA TE})) and
({FUND_SUMMARY.DMART_CURRE NCY} = "BASE" or
Isnull({FUND_SUMMARY.DMART _CURRENCY} )) and
{FUND_MASTER.EFFECTIVE_DAT E} = {?As of Date} and
({FUND_SUMMARY_IDX.ENT_TYP E} in ["CIDX", "INDX"] or Isnull({FUND_SUMMARY_IDX.E NT_TYPE}))
({FUND_MASTER_IDX.SNAPSHOT
{ENTITY_GROUP.ENTITY_NAME}
({FUND_SUMMARY_IDX.DMART_C
Isnull({FUND_SUMMARY_IDX.D
({FUND_MASTER_IDX.EFFECTIV
Isnull({FUND_MASTER_IDX.EF
({FUND_SUMMARY.DMART_CURRE
Isnull({FUND_SUMMARY.DMART
{FUND_MASTER.EFFECTIVE_DAT
({FUND_SUMMARY_IDX.ENT_TYP
That should work.
I would suggest that you reverse some of the selection criteria.
Crystal stops evaluating if you try to compare a NULL value to anything.
You should always test for NULL before comparing to a value
For instance
(
Isnull({FUND_SUMMARY.DMART _CURRENCY} )
OR
{FUND_SUMMARY.DMART_CURREN CY} = "BASE"
)
(
Isnull({FUND_MASTER_IDX.SN APSHOT_ID} )
OR
{FUND_MASTER_IDX.SNAPSHOT_ ID}="DEFAU LT"
)
(
Isnull({FUND_SUMMARY_IDX.D MART_CURRE NCY})
OR
{FUND_SUMMARY_IDX.DMART_CU RRENCY}="B ASE"
)
mlmcc
I would suggest that you reverse some of the selection criteria.
Crystal stops evaluating if you try to compare a NULL value to anything.
You should always test for NULL before comparing to a value
For instance
(
Isnull({FUND_SUMMARY.DMART
OR
{FUND_SUMMARY.DMART_CURREN
)
(
Isnull({FUND_MASTER_IDX.SN
OR
{FUND_MASTER_IDX.SNAPSHOT_
)
(
Isnull({FUND_SUMMARY_IDX.D
OR
{FUND_SUMMARY_IDX.DMART_CU
)
mlmcc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was it in crystal format! Thanks for the SQL help and null tips as well!
I'm glad I could help, but, personally, I think dsacker should get some points too. His code wouldn't work in your formula because it was in the wrong language, but all I did was copy his code and convert it to CR syntax.
You can ask to have the question re-opened and split the points between us.
And please do follow mlmcc's suggestion about the IsNull tests. They have to be first or there's no point in including them.
James
You can ask to have the question re-opened and split the points between us.
And please do follow mlmcc's suggestion about the IsNull tests. They have to be first or there's no point in including them.
James
Open in new window