CR2016 : Set Static Date Parameters for Yesterday!


I am finishing building my custom Sales Order Report that I want to run with my ERP software automatically. The report will be scheduled every morning between 1a - 3a and needs to look at 'yesterday's' orders that was entered in and then e-mail it out to the correct folks.

I have literally spent over a week 'Googleing' around on the web different ways of explaining what I want like 'data parameters crystal report 2016', etc. and I have been A.) unable to find anything that is CR 2008, which has some what a different interface/options than the newer version (CR 2016 SP3) so I am having a hard time finding the information to at least point me in the right direction.

I know a Formula will need to be built then 'Parameter Field' I think but I am not achieving the result I am looking for.

Currently, I have a pop up box that appears and asks for a date, which is working if you manually enter in the dates. However as I previously mentioned I need the date to be set to 'yesterday's' date and not pop up a box so that my report can run automatically.

Thank you all!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
One option is to change the record selection formula to NOT use a parameter, instead use something like:
{YourTable.Your_Transaction_Date} = CurrentDate - 1

Another option is to use one of the 3rd-party Crystal Reports scheduling tools that can use relative date logic to feed the existing parameter the date value of yesterday.  At least some of the tools listed here provide such functionality.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JustinBMakAuthor Commented:
Perfect! Didn't even think of the Record Selection Formula.

For folks that don't know what the 'Record Selection Formula' button is, in CR 2016 it's the yellow funnel in the center on the 3rd tool bar (default view).

In my @OrderDate formula, I changed it from:
(not HasValue({?Order Date (Optional Prompt)}) OR {@OrderDate} = {?Order Date (Optional Prompt)})


{@OrderDate} =  CurrentDate -1

Save and ran. Of course today is Monday so there were no orders entered yesterday. So I edited the query and put -3 instead (last Friday) and was able to retrieve the orders that were entered in on 04.05.19

Thank you again!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.