I need help on how to use a parameter to filter a column which is based on a formula.
I have a column which displays the date of last office visit. I need a parameter so that I can select the patients whose date of last office visit is between, say Jan 1, 2012 to June 30, 2012. Can anyone pls help?
Without seeing your code, I'm not sure, but I think it would probably work for you to put the test in the Group Selection Formula for the patients.
something like this:
{DOCUMENT.ClinicalDate} >= EMR_date_to_id({?startdate}) AND
{DOCUMENT.ClinicalDate} <= EMR_date_to_id({?enddate} + 1)
Report Custom Functions:
EMR_date_to_id:
Function (DateTimeVar theDate)
(
DateDiff("d", #1/1/1960#, theDate) * 1000000 * 86400
)
Thankyou for the replies. These are the formulas I am using right now.
@LastOfficeVisitDate
WhilePrintingRecords;
dateVar last_off_visit_date:=cdate("1901,01,01");
stringVar physician:="";
if {@ConvertDate}>last_off_visit_date
then
(last_off_visit_date:={@ConvertDate};
physician:=TOTEXT({DOCUMENT.USRID});
);
last_off_visit_date;
@ConvertDate
NumberVar ID := {DOCUMENT.CLINICALDATE};
NumberVar Sec := Truncate(ID / 1000000);
NumberVar Days := Truncate(Sec / 3600 / 24);
Date(DateTime(Date (1960,01,01 ) + Days, Time(0,0,0) + Sec));
What I need is to use a date range and be able to filter the patients whose last office visit dates fall within that date range. Since the record selection condition is based on the LastOfficeVisitDate it is giving the error:
"This formula cannot be used because it must be evaluated later."
So how about the Group Selection Formula, as I suggested above?
Sorry, I don't know how to do that. I am looking into it right now. Could you pls explain more.