I need to select records less or equal to a certain date but only if the person has at least 1 record with the date that I enter in the parameter and the other events they are attending aren't over. I'm using crystal 9 and getting the data from a mysql database.
PERSON_TABLE
id name
1 John Doe
2 Jane Doe
3 Jimmy Doe
CONFIRM_TABLE
id event_id entered event_date
1 1 2009-06-15 2009-07-05
1 2 2008-01-15 2008-02-15
1 6 2009-04-20 2009-06-29
2 1 2009-05-15 2009-07-05
2 5 2007-02-16 2006-03-15
3 4 2009-06-15 2009-08-16
The parameter is for the {CONFIRM_TABLE.entered field) so:
RESULTS wanted if I enter 2009-06-15 in the parameter:
id name event_id event_date
1 John Doe 1 2009-07-05
1 John Doe 6 2009-06-29 (event 2 is excluded because the event ended on 2008-02-15)
3 Jimmy Doe 4 2009-08-16
======
2 Jane Doe is excluded because there are no records entered on 2009-06-15
Thanks for you help.
PERSON_TABLE
id name
1 John Doe
2 Jane Doe
3 Jimmy Doe
CONFIRM_TABLE
id event_id entered event_date
1 1 2009-06-15 2009-07-05
1 2 2008-01-15 2008-02-15
1 6 2009-04-20 2009-06-29
2 1 2009-05-15 2009-07-05
2 5 2007-02-16 2006-03-15
3 4 2009-06-15 2009-08-16
The parameter is for the {CONFIRM_TABLE.entered field) so:
RESULTS wanted if I enter 2009-06-15 in the parameter:
id name event_id event_date
1 John Doe 1 2009-07-05
1 John Doe 6 2009-06-29 (event 2 is excluded because the event ended on 2008-02-15)
3 Jimmy Doe 4 2009-08-16
======
2 Jane Doe is excluded because there are no records entered on 2009-06-15
Thanks for you help.