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

Calculating Last Visit Date

Status
Not open for further replies.

jbopgaf

Technical User
Feb 20, 2001
13
AU
Hi,

I need to create a report that shows me clients that I have not visited since a particular date. (For example: Show my all clients/companies that I have not visited since the 20 Sep 2004.)

Are there any special date formulas that I can use?

(Using the Record Selection Expert does not rectify the issue.)

Thanks.
 
Group the report by {client}.

Create a formula that computes the maximum of visit date for each client: Maximum({visit_date}, {client})

Use a Group Selection Formula (Report, Edit Selection Formula, Group) that simply states that the maximum visit date is before a certain date.

Cheers,
- Ido



CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thanks Ido,

I gave this a go but I'm still having problems. I forgot to mention that I'm using a parameter (Enter Date...)

I've created the formula Maximum({visit_date}, {client})

Problem encountered with Group Selection Formula. It is expecting a date value but I'm using a parameter in the formula. Is this possible?

IE Maximum({visit_date}, {client})< {?VisitDate})

(I would like to report on all clients that I have not visited since the date that I have entered via the parameter.. so if “Client A” has been visited on the 20/9 and the 23/9 and the date entered is the 21/9, I would not expect to see “Client A” listed in my report even though the client was visited on the 20th because the client was also visited on the 23/9. Seems simple enough, but I must admit I’m struggling.)

I'm basically using two tables (First table stores company details and the 2nd table holds Visit details). Linking should be straight forward.

How would you go about creating this Ido?

Thanks.
 
A parameter can and should be of type date if it's being used against a date, go change its type.

Your formula looks sane to me, you probably defined the date parameter as a string or some such.

-k
 
Still having problems with this report. The parameter is date type. The error indicates that the calculation cannot be down now butlater.

Any ideas?

Thanks in advance.
 
Make sure you are creating the formula in the group selection area, not the record selection area. You also must have a group inserted on {table.client}. Your formula should look something like:

maximum({table.visitdate},{table.client}) < {?VisitDate}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top