Skip to Content
Former Member
Aug 29, 2007 at 07:21 PM

Selecting records based on user formula


Post Author: Josh@RTA

CA Forum: Formula

I'm writing reports for a company that stores all of their dates as 8 digit numerical fields rather than a date or datetime datatype. I want to convert this field to a date type, then compare it to a parameter that stores user input as a date type.

However, due to the way that Crystal does it's passes over the data, I can't use a selection formula based off of another formula. So I'm wondering , has anyone ever used a selection formula that references another formula and how have you been able to do it? Maybe use group selection instead of record selection? Just not sure.

I'm including the formula I'm using to convert the date, as well as the selection formula so you get an Idea of what I'm doing.

//This converts the numeric 'date' field to a dateshared stringvar DateString := totext({wotrans.ROP_TRAN_DATE}, 0, '');shared datevar ConvertedDate :=If {wotrans.ROP_TRAN_DATE} < 19590101 then Date (1959, 01, 01) else Date ( Val (DateString &#91;1 to 4&#93;), Val (DateString &#91;5 to 6&#93;), Val (DateString &#91;7 to 8&#93;) );

//This is the select statement I'm using to compare the above formula to my parameter using record selection{@ConvertedTransDate} = {?TransDateRange}