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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

records selection formula

Status
Not open for further replies.

chrisp909

Technical User
Aug 1, 2001
92
US
I need to make a selection from VB that has multiple parameters:

Code:
campaign.RecordSelectionFormula = &quot;{MarketingCampaign.MarketingCampaign_Start_Date} >= Date (&quot; & sStartdate & &quot;)&quot; & &quot;AND {MarketingCampaign.MarketingCampaign_End_Date} <= Date (&quot; & sEndDate & &quot;)&quot; & &quot;AND {MarketingCampaign.MarketingCampaign_Cost} > 500&quot;

this selects using the date varibles but not the 500 dollar cost. That is ignored.

I have had trouble right along making multiple parameter selections. This one with the two dates was the first I was able to make work.

I have also tried sqlquerystring with the same results. Anyone know how I can do this.

This has got to be easy and I am just missing something
 
{MarketingCampaign.MarketingCampaign_Cost} > 500&quot;

I don't think 500 is being treated as a number
 
Let me recap:

This
Code:
campaign.RecordSelectionFormula = &quot;{MarketingCampaign.MarketingCampaign_Cost} >&quot; 500
works fine

This
Code:
campaign.RecordSelectionFormula = &quot;{MarketingCampaign.MarketingCampaign_Start_Date} >= Date (&quot; & sStartdate & &quot;)&quot; & &quot;AND {MarketingCampaign.MarketingCampaign_End_Date} <= Date (&quot; & sEndDate & &quot;)&quot;
works fine

it's when i try to combine them that the results are not what i want. I want to be able to select from the date range and from a particular cost range as well.
 
Can you get this formula to work within the Crystal Reports designer?
Did you notice that in your 2 posts, the quotes near the 500 are in 2 different places? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
comes back to my comment about the 500 being read as a character...not a number
 
Ken,

Yes I did notice about the quotes, and proper quote placement was the whole issue. I had spent too long in front of the computer and needed to get away from it for a while.

Thanks

Chris

PS
The CR Primer I purchased from your website was a lot of help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top