Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Populating Parameter Fields With Variables? Post Reply Post New Topic
Author Message
SPackard
Newbie
Newbie


Joined: 03 Feb 2011
Location: United States
Online Status: Offline
Posts: 3
Quote SPackard Replybullet Topic: Populating Parameter Fields With Variables?
    Posted: 11 Mar 2011 at 5:37am
Hi,
 
I'm wondering if there is any way to add a variable to a string parameter so that the parameter field can be changed without having to manually change the data.   This seems like it should be easy enough but I've tried and had no luck.

Basically here's my situation:  I have three parameters that are being used to in order to filter the data from an SQL database.

They look something like this:
 
PeriodAFilter =  (VI_PS_TKT_HIST.POST_DAT >= '2010-11-01') and   (VI_PS_TKT_HIST.POST_DAT <= '2011-03-10')
 
PeriodBFilter =  (VI_PS_TKT_HIST.POST_DAT >= '2010-11-01') and   (VI_PS_TKT_HIST.POST_DAT <= '2011-03-10') and((((VI_PS_TKT_HIST_LIN.ITEM_NO = 'WEBSALE_ITEM')))
 
PeriodCFilter = (VI_PS_TKT_HIST.POST_DAT >= '2010-11-01') and   (VI_PS_TKT_HIST.POST_DAT <= '2011-03-10') and((((VI_PS_TKT_HIST_LIN.ITEM_NO = 'DELIVERY_ITEM'))) or (((VI_PS_TKT_HIST_LIN.ITEM_NO = 'SHIPPING_ITEM'))))


So obviously there is some redundancy here.   Every time I want to change the date range for the items I want returned I have to change all three parameter fields.   (These are static string parameters, btw)
 
What I really want is to have look like:
 
PeriodAFilter =  (VI_PS_TKT_HIST.POST_DAT >= MyStateDateVariable) and   (VI_PS_TKT_HIST.POST_DAT <= MyEndDateVariable)
 

That way I could just change a single easy variable to get the date to what I want.   Seems simple enough.
 
Well I've tried this a bunch of ways.  I tried defining a parameter to use as the variable and that didn't seem to work.  I tried using a formula and that didn't seem to work.   Unless, of course, I'm somehow doing the syntext wrong or just missing something entirely
 
Any ideas?
 
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.