Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Variables to ReportSelectionFormula

Status
Not open for further replies.

kab555

Programmer
Jan 18, 2002
46
US
I am using Crystal 8, and VB6. I have lots of places for users to input values on which to select records. I am passing my formulas to strings, and now need to put all these strings together for the recordSelectionFormula. I am currently in some sort of infinite loop. Does anybody have the correct syntax? Here is a snipit of code. My problem area is in the very last line.

StrSelectionFormula = &quot;{KB_CLAIM_POLICY_AMT_VIEW.TRANS_DATE} >= #&quot; & FromDate & &quot;# and {KB_CLAIM_POLICY_AMT_VIEW.TRANS_DATE} <= #&quot; & ToDate & &quot;# And {CLAIM_STATUS_HISTORY.STATUS_START_DATE} < #&quot; & ToDate & &quot;# And {CLAIM_STATUS_HISTORY.STATUS_END_DATE} >= #&quot; & ToDate & &quot;# And {CLAIM_TYPE_HISTORY.TYPE_START_DATE} < #&quot; & ToDate & &quot;# And {CLAIM_TYPE_HISTORY.TYPE_END_DATE} >= #&quot; & ToDate & &quot;# And & StrPolicySelectFormula&quot;


 
You might want to do this:

StrSelectionFormula = &quot;{KB_CLAIM_POLICY_AMT_VIEW.TRANS_DATE} >= #&quot; & FromDate & &quot;# and {KB_CLAIM_POLICY_AMT_VIEW.TRANS_DATE} <= #&quot; & ToDate & &quot;# And {CLAIM_STATUS_HISTORY.STATUS_START_DATE} < #&quot; & ToDate & &quot;# And {CLAIM_STATUS_HISTORY.STATUS_END_DATE} >= #&quot; & ToDate & &quot;# And {CLAIM_TYPE_HISTORY.TYPE_START_DATE} < #&quot; & ToDate & &quot;# And {CLAIM_TYPE_HISTORY.TYPE_END_DATE} >= #&quot; & ToDate

StringForRecordSelectionFormula = StrSelectionFormula & StrPolicySelectFormula
 
Thanks for the help. VB didn't like it, but I've figured out the syntax. It should be:

StrSelectionFormula = &quot;{KB_CLAIM_POLICY_AMT_VIEW.TRANS_DATE} >= #&quot; & FromDate & &quot;# and {KB_CLAIM_POLICY_AMT_VIEW.TRANS_DATE} <= #&quot; & ToDate & &quot;# And {CLAIM_STATUS_HISTORY.STATUS_START_DATE} < #&quot; & ToDate & &quot;# And {CLAIM_STATUS_HISTORY.STATUS_END_DATE} >= #&quot; & ToDate & &quot;# And {CLAIM_TYPE_HISTORY.TYPE_START_DATE} < #&quot; & ToDate & &quot;# And {CLAIM_TYPE_HISTORY.TYPE_END_DATE} >= #&quot; & ToDate & &quot;# And&quot; & StrPolicySelectFormula

A quote AFTER the very last And, then the &, and then the variable name.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top