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

Simple way to prompt for print date when refreshing report?

Status
Not open for further replies.

LeCras

IS-IT--Management
Feb 27, 2002
58
GB
Hi all,

I am currently trying to compose a report for the IT helpdesk which will show all help calls that have been outstanding for more than 60 days. This will be used to show statistics for each month.

The problem I have at the moment is that whoever runs the report needs to manually go in and set the Print Date before running the report to avoid the figures being incorrect.

Is there a way to prompt the user to input, say, the first day of the month for which they want to run the report? For example, if they wanted to see what the figures were for May they could input "01/05/02" or similar at a prompt when the report was refreshed.

Hopefully I have explained fairly well what I am after, if not please feel free to ask me for more information!

Also, I'm pretty new to Crystal Reports so I would appreciate if you could try and be pretty basic with any replies... ;-)

Many thanks,

C. Le Cras
 
You can create a parameter (Insert->Field Object->Right Click Parameter Fields and select New) of type date, if your database has a type of datetime, you may want change this to a datetime to assure that the criteria is passed to the database, or use a formula against the parameter and change the type in it for use in the record selection criteria.

Here's an example of a record selection criteria (use Report->Edit Selection Formula-Record):

(
({MyTable.Mydatetime} >= {?MyDatetimeparm})
)

-k kai@informeddatadecisions.com
 
Thanks for that, synapsevampire. Unfortunately it doesn't really answer my question. What I would like to happen is for the user to be prompted to enter PrintDate every time the report is refreshed, so that the data displayed is as of that specified day. This would enable someone to see how many calls had been outstanding for more than 60 days on any given day.

I have tried creating a date parameter, but that doesn't seem to pull down the correct data. Also, I can't seem to get the parameter to show up in the Select Expert...

Sorry to be a pain and thanks for your help so far :)

C. Le Cras
 
Creating a date parameter, as SV pointed out, is only the first step.

The second step is to tie the parameter field into a record selection formula to restruict your report to the records you want to see, in your case the 60 days prior to the parameter field.

Did you do step 2? Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Well, this still doesn't prompt me to enter a Print Date when I refresh the report, which is really what I'm after. I already have the record selection criteria sorted, the report works fine. I was just wondering if there was a way of avoiding having to manually go to Report > Set Print Date/Time, since I know that the person who will be running this report is bound to forget doing this unless there is a prompt, resulting in incorrect data...

C. Le Cras
 
Hey C,

I think you and your advisors here must be talking at cross-purposes. If you really had the record selection criteria sorted, as you say, then you would be prompted for the date.

You should be aiming to replicate the kind of syntax than SynapseVampire illustrated to you.

Post the selection criteria you're currently using, and someone will sort you right out.

Naith
 
Ok, here is the selection criteria I'm using at the moment:

{CallLog.CallStatus} <> &quot;Closed&quot; and
HFWDateToDate({CallLog.RecvdDate}) IN Over90Days and
{CallLog.CallType} = &quot;SRD&quot;

I have a feeling &quot;HFWDateToDate&quot; might be specific to the product this report is run against ( a helpdesk package called Heat) although I could be wrong.

So basically what I'm trying to achieve is for users to be prompted to input a date as of which they want to run this report. This would return any SRD calls that had been soutstanding for more than 90 days on the day the user specified...

Hope this makes it a bit clearer - I did warn you guys that I'm a Crystal beginner lol!

C. Le Cras
 
We were all beginners back in the day. I have personally asked some humdingers in my time.

What you want to do is change your selection criteria so it looks like this:
Code:
{CallLog.CallStatus} <> &quot;Closed&quot; and
HFWDateToDate({CallLog.RecvdDate}) IN {?YourDateParameter}to ({?YourDateParameter} - 90) and
{CallLog.CallType} = &quot;SRD&quot;
The changes I've made just mean return the Call Logs which were received between the user specified date, and 90 days before that date.

Good luck,

Naith
 
I have no idea why I just posted that.

That criteria is for if you want data returned which is no older than 90 days before your date.

You clearly stated that you wanted data over 90 days prior to the specified date.

What I should have said was change your selection formula to:
Code:
{CallLog.CallStatus} <> &quot;Closed&quot; and
HFWDateToDate({CallLog.RecvdDate}) < ({?YourDateParameter} - 90) and
{CallLog.CallType} = &quot;SRD&quot;
I apologise for any confusion.

Naith
 
Naith,

Aaah, brilliant - that works wonderfully! Feel a bit silly now, that should have been pretty straight forward to figure out... ;-)

If you're ever in sunny Jersey the pints are on me!

Thanks again,

Charlotte
 
Glad it worked out for you.

I was in Jersey over the weekend, oddly enough. I'll let you off on the pints, though.
 
No way! LOL small world and all that...

Well, I'll buy you one next time :)

C
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top