I want to create a parameter based upon DOCUMENT.CLINICALDATE but CR is not allowing me to link the two via Select Expert.
Help?
that's because ClinicalDate is stored as a number. you'll have to reverse engineer the parameter date to a number of the same format before you can use it for comparisons.
Okay, I have a new formula created that converts it to a date. How do I build a parameter for a formula value though?
sorry. you need to create a formula converting your parameter date into a number and then compare the clinicaldate to this formula in your select criteria.
you could also do it this way:
{DOCUMENT_1.CLINICALDATE} >= (DateDiff("d", #1/1/1960#, #1/1/2012#) * 24 * 60 * 60 * 1000000)
and {DOCUMENT_1.CLINICALDATE} < (DateDiff("d", #1/1/1960#, #1/1/2013#) * 24 * 60 * 60 * 1000000)
this compares for 1 year. change the parts in red to your begin/end parameters.
Could I point two parameters (start & end) to this formula like below? Then use Select Expert to filter to this new formula's value? Are the #'s required around the parameter identifier?
{DOCUMENT.CLINICALDATE} >= (DateDiff("d", #1/1/1960#, #({?Start})#) * 24 * 60 * 60 * 1000000) AND {DOCUMENT.CLINICALDATE} < (DateDiff("d", #1/1/1960#, #({?End})#) * 24 * 60 * 60 * 1000000)
take out the # (used to specify a date) and take out the () after the # and it should work.
I use the following formula
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));
Then it can be used in record selection formula as:
({@ ConvertDate}>=#10/01/2012# and {@ConvertDate}<=#31/3/2013#)
If dates are parameters record selection formula will be
({@ ConvertDate}>={?DateFrom} and {@ConvertDate}<={?DateTo})
Thanks all. I actually went with the below formula.
{@CDate} in {?StartDate} to {?EndDate}