Crystal PrintDate vs. CurrentDate

Hello:

A client wants a field of two asterisks to show on the Crystal 8.5 report if the date that the report was printed is less than or equal to the current date.

As a formula for such asterisks, will this work?:

If PrintDate <= CurrentDate then '**' else ''

Thanks!

TBSupport
LVL 1
TBSupportAsked:
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.

vastoCommented:
You probably want to compare a parameter. Printing date will be always equal to the current date.
If you have a date parameter PrintDate you can do
If {?PrintDate} <= CurrentDate then '**' else ''
0
mlmccCommented:
Agree.  PrintDate is just the date the report is printed which obviously when you run the report is today or currentdate.

What is he trying to get from the date?

mlmcc
0
mlmccCommented:
DO you have a PrintDate field in your database or are you referring (as we have assumed) to the special field in Crystal called PrintDate?

mlmcc
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

frankhelkCommented:
Printing date will be always equal to the current date.

That's not the complete truth ... while the printing date is completely constant thru the report generation process, the current date still ticks ... If you create a formula
WhilePrintingRecords;
CStr(CurrentDate)+" - "+CStr(PrintingDate)

Open in new window

and insert it at top and bottom of a lengthy report, you'll see different timestamps for CurrentDate but same values for PrintingDate.
0
TBSupportAuthor Commented:
Hello:

I really appreciate all of the responses.  But, I'm afraid that I'm at a loss.

For example, how and why do I need to plus a print date parameter into the mix?  That forces the customer to have to use a parameter, every time they want to generate this report.

As far as "what he's trying to get from the date", it's not much more than what I said.  He's trying to print asterisks on the report if that report has been printed out of Crystal.  He, also, wants the asterisks to display next to the groupings of document numbers that appear on the left-hand side of the report.

The "WhilePrintingRecords" scenario mentioned by frankhelk sounds pretty promising.  But, I don't know how to administer that or how to tell it to print asterisks on the report or in the groupings on the left.

Help!

TBSupport
0
mlmccCommented:
You are probably correct when you factor in the time and not just the date.

I can see if the report is run near midnight and actually crosses over that there might be a difference in the dates.

So in his case he will mark most of the records because of the time it takes to print the report.  I don't think that is what he wants.

mlmcc
0
TBSupportAuthor Commented:
So, how do I get this to work?  :)

TBSupport
0
mlmccCommented:
frankhelk
I just tried your formula and there is no change in either date.  In fact both dates when I tried to format them are just dates with no time associated  so there is nothing to change unless you happen to cross midnight.

TBSupport
What do the ** signify?
What is he trying to determine using them

My test seems to confirm what I initially said that the 2 will always be the same (with the exception of a very special case).

mlmcc
0
mlmccCommented:
To try it yourself

Create the formula you suggested
Drag it onto the report where you want it to appear
Run the report

mlmcc
0
TBSupportAuthor Commented:
mlmcc:

Which formula?  I'm unclear.

TBSupport
0
mlmccCommented:
The one you used in the question

WhilePrintingRecords;
If PrintDate <= CurrentDate then '**' else ''

I don't think you will see any **

mlmcc
0
TBSupportAuthor Commented:
Hi mlmcc:

The asterisks are still there, even in situations where there shouldn't be.

The '**' signify that the report has been printed.

TBSupport
0
frankhelkCommented:
Opps - my mistake ... I should test such things before posting 'em ...

CurrentDate replects the date (w/o time) at the time the formula is evaluated. That time point differs, and if your reports needs to pass midnight while running, it might differ if evalusted while printing.

The thing I meant was CurrentDateTime, and that differs definitely ... if you include it into a lengthy report with many lines, you see it change when evaluated i.e. WhileReadingRecords. If you put such a time stamp in the report's header and footer with a proper evaluation time, you can determine how long it runs.

PrintDate and PrintTime represent the point of time when the report is printed. But that usually only makes sense for printed timestamps, not for evaluation.

DataTime and DataDate reflect the point of time when the data was accquired from the data source.

If one likes to experiment, he could insert this formula
BeforeReadingRecords;
// WhileReadingRecords;
// WhilePrintingRecords;
"Current: " + CStr(CurrentDateTime) + " /  Print: " + CStr(PrintDate) + " " + CStr(PrintTime) + " / Data: " + CStr(DataDate) + " " + CStr(DataTime) 

Open in new window

into a report at various positions and experiment with the evaluation time directives. That should clearly outline the differences.
0
TBSupportAuthor Commented:
Thanks, frankhelk!  

But, where are the asterisks?  :)

TBSupport
0
frankhelkCommented:
The asterisks are not part of the formula due to the fact that the formula is for educational purposes only (I presume they're on the search for Obelix and Idefix ;-)

The thing you've searched for is a bit out of the scope or CR ... "printed" in CR means - as far as I understand it -  that the report has been prepared (the data has been processed and been cast into the given format). The sheer act of shoving it to a printer after generating the layout doesn't count in that point of view.
0
TBSupportAuthor Commented:
OK.  I guess let's forget "shoving it in a printer".  We'll go with the fact that the client needs a comparison of when this was last generated and needs asterisks to print accordingly, as I have said numerous times in this post.

This report, at one time, was indeed showing asterisks and conducting this comparison.  Then, our accounting system was upgraded.  Now, all of a sudden, the report is not doing this comparison.

So, I gotta find a way to get this to work, again.  No offense.  But, stating that this is out of the scope of Crystal work doesn't help me any, especially when I should be getting solid answers from this Forum.

TBSupport
0
vastoCommented:
I have hard time to understand the logic in this report. As far as I know PrintDate and CurrentDate will be the same except if you force the report to print with specific date. In other words you can set the PrintDate , while CurrentDate will be always the system date of the computer. If you would like to try different printdate select menu Report-> Set PrintDate and Time. May be whoever wrote this report wanted to implement "time machine" and to pretend you can go back in time.

If you not set PrintDate explicitly it will be set to the current date even if you save data with the report.
0
TBSupportAuthor Commented:
What does Report-> Set PrintDate and Time do?
0
vastoCommented:
It will set PrinDate to whatever date you want. Then you can use the PrintDate to filter your data and to pretend you are back in a different point in time
0
frankhelkCommented:
OK - let's go just back and try some brute force procedure ...

If I'm in doubt what data is to be used, I just add an additional section at the right place wher it is to be evaluated, insert the data items I use (or suspect to be usable) and generate the report. Then I look at the results and design my formulas according to the results ...

If you could regenerate an old report, I would recommend to do that in the old system, too.

Check the outcome for differences and act accordingly.
0

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
TBSupportAuthor Commented:
Hi frankhelk:

I apologize, for my earlier remarks.  I was just frustrated.

Thanks, for your help!

TBSupport
0
frankhelkCommented:
No problem with that ... I admit that I went a bit astray of your problem, so I'm a bit guilty, too.

And: You're welcome.
0
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
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.