Thursday, March 22, 2012

Date Parameter Procedure

I am trying to create a Parameter for entering a Date Range for a report,
here is what I think the syntax should look like, but it is wrong;
"Create Procedure procAccrual Aging
as
Select Distinct Receiptdate
from pop30310
where (pop30310.receiptdate between @.BeginDate and @.EndDate)"
As you seen, I am trying to create a beginning and ending range parameter.
Thank you,
RyanOn Jun 17, 7:49 pm, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
wrote:
> I am trying to create a Parameter for entering a Date Range for a report,
> here is what I think the syntax should look like, but it is wrong;
> "Create Procedure procAccrual Aging
> as
> Select Distinct Receiptdate
> from pop30310
> where (pop30310.receiptdate between @.BeginDate and @.EndDate)"
> As you seen, I am trying to create a beginning and ending range parameter.
> Thank you,
> Ryan
If I'm understanding you correctly, you will want to create your
stored procedure for your report like this:
Create Procedure procAccrual Aging
@.BeginDate DATETIME,
@.EndDate DATETIME
as
Select Distinct Receiptdate
from pop30310
where (pop30310.receiptdate between @.BeginDate and @.EndDate)
Then have the @.BeginDate and @.EndDate report parameters based on a
standard calendar datetime control (default for datetime parameters).
Then in the Data view, where you define the dataset for the stored
procedure procAccrual Aging then in the Parameters tab of the Edit
Dataset [...] section, select the report parameters. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Ed,
The procedure works now, but when I preview the report and enter a range,
the data still spits out the same. Is there some linking that needs to be
done?
Thanks,
Ryan
"EMartinez" wrote:
> On Jun 17, 7:49 pm, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
> wrote:
> > I am trying to create a Parameter for entering a Date Range for a report,
> > here is what I think the syntax should look like, but it is wrong;
> >
> > "Create Procedure procAccrual Aging
> > as
> > Select Distinct Receiptdate
> > from pop30310
> > where (pop30310.receiptdate between @.BeginDate and @.EndDate)"
> >
> > As you seen, I am trying to create a beginning and ending range parameter.
> >
> > Thank you,
> >
> > Ryan
>
> If I'm understanding you correctly, you will want to create your
> stored procedure for your report like this:
> Create Procedure procAccrual Aging
> @.BeginDate DATETIME,
> @.EndDate DATETIME
> as
> Select Distinct Receiptdate
> from pop30310
> where (pop30310.receiptdate between @.BeginDate and @.EndDate)
> Then have the @.BeginDate and @.EndDate report parameters based on a
> standard calendar datetime control (default for datetime parameters).
> Then in the Data view, where you define the dataset for the stored
> procedure procAccrual Aging then in the Parameters tab of the Edit
> Dataset [...] section, select the report parameters. Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On Jun 18, 10:00 am, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
wrote:
> Ed,
> The procedure works now, but when I preview the report and enter a range,
> the data still spits out the same. Is there some linking that needs to be
> done?
> Thanks,
> Ryan
> "EMartinez" wrote:
> > On Jun 17, 7:49 pm, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
> > wrote:
> > > I am trying to create a Parameter for entering a Date Range for a report,
> > > here is what I think the syntax should look like, but it is wrong;
> > > "Create Procedure procAccrual Aging
> > > as
> > > Select Distinct Receiptdate
> > > from pop30310
> > > where (pop30310.receiptdate between @.BeginDate and @.EndDate)"
> > > As you seen, I am trying to create a beginning and ending range parameter.
> > > Thank you,
> > > Ryan
> > If I'm understanding you correctly, you will want to create your
> > stored procedure for your report like this:
> > Create Procedure procAccrual Aging
> > @.BeginDate DATETIME,
> > @.EndDate DATETIME
> > as
> > Select Distinct Receiptdate
> > from pop30310
> > where (pop30310.receiptdate between @.BeginDate and @.EndDate)
> > Then have the @.BeginDate and @.EndDate report parameters based on a
> > standard calendar datetime control (default for datetime parameters).
> > Then in the Data view, where you define the dataset for the stored
> > procedure procAccrual Aging then in the Parameters tab of the Edit
> > Dataset [...] section, select the report parameters. Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
I'm assuming you are addressing me. Have you linked the parameters
that the stored procedure is expecting in the Data tab view with the
report parameters? You would check this via selecting the dataset that
references the stored procedure in the Data view, select the [...]
button to the right of the dataset, for Edit dataset, then select the
Parameters tab and set/verify that @.BeginDate, @.EndDate have the
correct Report parameters associated with them. The values should be
whatever your report parameters are named (i.e., Parameters!
BeginDate.Value and Parameters!EndDate.Value). Hope this clarifies
things for you.
Regards,
Enrique Martinez
Sr. Software Consultant|||Enrique,
Thanks for all of your help? What is your address? I am going to have to
send you a bottle of Scotch my friend!
Ryan
"EMartinez" wrote:
> On Jun 18, 10:00 am, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
> wrote:
> > Ed,
> > The procedure works now, but when I preview the report and enter a range,
> > the data still spits out the same. Is there some linking that needs to be
> > done?
> >
> > Thanks,
> > Ryan
> >
> > "EMartinez" wrote:
> > > On Jun 17, 7:49 pm, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
> > > wrote:
> > > > I am trying to create a Parameter for entering a Date Range for a report,
> > > > here is what I think the syntax should look like, but it is wrong;
> >
> > > > "Create Procedure procAccrual Aging
> > > > as
> > > > Select Distinct Receiptdate
> > > > from pop30310
> > > > where (pop30310.receiptdate between @.BeginDate and @.EndDate)"
> >
> > > > As you seen, I am trying to create a beginning and ending range parameter.
> >
> > > > Thank you,
> >
> > > > Ryan
> >
> > > If I'm understanding you correctly, you will want to create your
> > > stored procedure for your report like this:
> > > Create Procedure procAccrual Aging
> > > @.BeginDate DATETIME,
> > > @.EndDate DATETIME
> > > as
> >
> > > Select Distinct Receiptdate
> > > from pop30310
> > > where (pop30310.receiptdate between @.BeginDate and @.EndDate)
> >
> > > Then have the @.BeginDate and @.EndDate report parameters based on a
> > > standard calendar datetime control (default for datetime parameters).
> > > Then in the Data view, where you define the dataset for the stored
> > > procedure procAccrual Aging then in the Parameters tab of the Edit
> > > Dataset [...] section, select the report parameters. Hope this helps.
> >
> > > Regards,
> >
> > > Enrique Martinez
> > > Sr. Software Consultant
>
> I'm assuming you are addressing me. Have you linked the parameters
> that the stored procedure is expecting in the Data tab view with the
> report parameters? You would check this via selecting the dataset that
> references the stored procedure in the Data view, select the [...]
> button to the right of the dataset, for Edit dataset, then select the
> Parameters tab and set/verify that @.BeginDate, @.EndDate have the
> correct Report parameters associated with them. The values should be
> whatever your report parameters are named (i.e., Parameters!
> BeginDate.Value and Parameters!EndDate.Value). Hope this clarifies
> things for you.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On Jun 18, 1:34 pm, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
wrote:
> Enrique,
> Thanks for all of your help? What is your address? I am going to have to
> send you a bottle of Scotch my friend!
> Ryan
> "EMartinez" wrote:
> > On Jun 18, 10:00 am, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
> > wrote:
> > > Ed,
> > > The procedure works now, but when I preview the report and enter a range,
> > > the data still spits out the same. Is there some linking that needs to be
> > > done?
> > > Thanks,
> > > Ryan
> > > "EMartinez" wrote:
> > > > On Jun 17, 7:49 pm, Ryan Mcbee <RyanMc...@.discussions.microsoft.com>
> > > > wrote:
> > > > > I am trying to create a Parameter for entering a Date Range for a report,
> > > > > here is what I think the syntax should look like, but it is wrong;
> > > > > "Create Procedure procAccrual Aging
> > > > > as
> > > > > Select Distinct Receiptdate
> > > > > from pop30310
> > > > > where (pop30310.receiptdate between @.BeginDate and @.EndDate)"
> > > > > As you seen, I am trying to create a beginning and ending range parameter.
> > > > > Thank you,
> > > > > Ryan
> > > > If I'm understanding you correctly, you will want to create your
> > > > stored procedure for your report like this:
> > > > Create Procedure procAccrual Aging
> > > > @.BeginDate DATETIME,
> > > > @.EndDate DATETIME
> > > > as
> > > > Select Distinct Receiptdate
> > > > from pop30310
> > > > where (pop30310.receiptdate between @.BeginDate and @.EndDate)
> > > > Then have the @.BeginDate and @.EndDate report parameters based on a
> > > > standard calendar datetime control (default for datetime parameters).
> > > > Then in the Data view, where you define the dataset for the stored
> > > > procedure procAccrual Aging then in the Parameters tab of the Edit
> > > > Dataset [...] section, select the report parameters. Hope this helps.
> > > > Regards,
> > > > Enrique Martinez
> > > > Sr. Software Consultant
> > I'm assuming you are addressing me. Have you linked the parameters
> > that the stored procedure is expecting in the Data tab view with the
> > report parameters? You would check this via selecting the dataset that
> > references the stored procedure in the Data view, select the [...]
> > button to the right of the dataset, for Edit dataset, then select the
> > Parameters tab and set/verify that @.BeginDate, @.EndDate have the
> > correct Report parameters associated with them. The values should be
> > whatever your report parameters are named (i.e., Parameters!
> > BeginDate.Value and Parameters!EndDate.Value). Hope this clarifies
> > things for you.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
Glad I could be of assistance. Thanks for the offer, however, I'm not
much into drinking.
Best Regards,
Enrique

No comments:

Post a Comment