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!

Displaying the number of days between visits.

Status
Not open for further replies.

terenceb

Programmer
Jun 10, 2003
77
US
Hi ALL'

I am using Crystal 8.5, SQL tables on a Cashe database.

I need to display the number days between visits, for example if a client was seen on 9/11/2003 and again on 10/23/2003. I need to display 42. Also, how would I store the days in an array if my client has been seen more that twice. I would need to now the number of days between each visit. And the use the that clients to determine if he is seen Weekly, Bi-Weekly, Monthly, Bi-Monthly or Quarterly.

Thank You
 
I'm fingding it difficult to visualise what you are doing,

Please post a sample of the data and the expected output...

Reebo
UK

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."
- Albert Einstein (1879-1955)
 
What I need to do is catagorize the appointment our clinicians keep with their clients. We want to catagorize them as Weekly visits, Bi-Weekly, Monthly, Bi-Monthly and Quarterly. So I need to count the number of days between the visits to put them in the correct catagory. For example, we are looking at a 3 month range of visits. If the client is seen on 9/11/2003,10/23/2003 and 11/26/2003 he is seen on a Monthly basis.

Output should look like :

Staff 1001
Monthly
1
 
Number of days is given by
DateDiff("d", @visit, @previousvisit)

If you call this @DayDiff, you could then use the correct name, something like
if @DayDiff < 7 then &quot;Bi-Weekly&quot;
else if @DayDiff < 14 then &quot;Weekly&quot;
etc.

You can also use DateDiff(&quot;w&quot;... and DateDiff(&quot;m&quot;... for weeks and months. Bi-weekly etc. you will need to sort out with your own logic.

If it is multiple visits, that is more complex. Note that you can use Previous(Field) and Next(Field)


Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top