Jump to content

Next future date in a list (portal) of dates.


This topic is 5770 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello all,

I've got a table for patients and another table for visits. I need a list of patients with their next appointment date. Each patient has multiple appointments from the past and for the future.

I tried creating a calc in visits that said:

case(appointment date > get(currentdate); patient ID)

Then I could build a relationship from the patients table to the visits table based on Patient ID.

That of course works once: since you can't build a relationship on an unstored calc the current date doesn't update.

Is there a custom function I can use?

Link to comment
Share on other sites

You don't need a custom function for this. In your Patients table, define an unstored calculation field cToday (result is Date) =

Get (CurrentDate)

Then define your relationship as:

Patients::PatientID = FutureVisits::PatientID

AND

Patients::cToday < FutureVisits::AppointmentDate

where FutureVisits is an occurence of the Visits table. This relationship will show all future visits of the current patient.

Edited by Guest
corrected a typo: reversed < sign
Link to comment
Share on other sites

This topic is 5770 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.