Tech2377
Programmer
- Nov 13, 2007
- 81
I am using Ken Hamady's Age Formula (
I need some help on a report. My report currently has 5 detail bands (A - E) and each utilize the @Age formula. Its seems the weeks and months at certain levels trigger the wrong form. I just came across an 8 week old and a 7 month old that were incorrect and printing the 7-18 yr forms. I am a bit stumped as to where the defining problem is. Perhaps I should rework this entirely to pull the right form. Any questions, please ask. I appreciate any help!
Birth to 6 yrs Old. (Details A)
Female 7 - 18 yrs old (Details B)
Male 7 - 18 yrs old (Details C)
Adult Female (over 18 yrs old) (Details D)
Adult Male (over 18 yrs old) (Details E)
Code:
WhileReadingRecords;
DateVar Birth:= date({SB1001_main.PatientBirthdate}); // Replace this with your field for Date Of Birth
DateVar Ann := date({SB1001_main.ApptStart}); // Replace this with CurrentDate to get their age as of the time of the report
//or the date field of an event to get their age as of the time of that event.
if (Month(Ann) * 100) + Day (Ann) >=(Month(Birth) *100) + Day (Birth)
then Year (Ann) - Year(Birth)
else Year (Ann) - Year(Birth) -1
I need some help on a report. My report currently has 5 detail bands (A - E) and each utilize the @Age formula. Its seems the weeks and months at certain levels trigger the wrong form. I just came across an 8 week old and a 7 month old that were incorrect and printing the 7-18 yr forms. I am a bit stumped as to where the defining problem is. Perhaps I should rework this entirely to pull the right form. Any questions, please ask. I appreciate any help!
Birth to 6 yrs Old. (Details A)
Code:
ToNumber({@Age}) >= 19 and {SB1001_main.PatientSex} = 'M'
OR
ToNumber({@Age}) >= 19 and {SB1001_main.PatientSex} = 'F'
OR
(ToNumber({@Age}) in (7 to 18)) and {SB1001_main.PatientSex} = 'F'
OR
(ToNumber({@Age}) in (7 to 18)) and {SB1001_main.PatientSex} = 'M'
Female 7 - 18 yrs old (Details B)
Code:
ToNumber({@Age}) >= 19 and {SB1001_main.PatientSex} = 'M'
OR
ToNumber({@Age}) >= 19 and {SB1001_main.PatientSex} = 'F'
OR
(ToNumber({@Age}) in (0 to 6))
OR
(ToNumber({@Age}) in (7 to 18)) and {SB1001_main.PatientSex} = 'M'
Male 7 - 18 yrs old (Details C)
Code:
ToNumber({@Age}) >= 19 and {SB1001_main.PatientSex} = 'M'
OR
ToNumber({@Age}) >= 19 and {SB1001_main.PatientSex} = 'F'
OR
(ToNumber({@Age}) in (0 to 6))
OR
(ToNumber({@Age}) in (7 to 18)) and {SB1001_main.PatientSex} = 'F'
Adult Female (over 18 yrs old) (Details D)
Code:
ToNumber({@Age}) >= 19 and {SB1001_main.PatientSex} = 'M'
OR
(ToNumber({@Age}) in (0 to 6))
OR
(ToNumber({@Age}) in (7 to 18)) and {SB1001_main.PatientSex} = 'M'
OR
(ToNumber({@Age}) in (7 to 18)) and {SB1001_main.PatientSex} = 'F'
Adult Male (over 18 yrs old) (Details E)
Code:
ToNumber({@Age}) >= 19 and {SB1001_main.PatientSex} = 'F'
OR
(ToNumber({@Age}) in (0 to 6))
OR
(ToNumber({@Age}) in (7 to 18)) and {SB1001_main.PatientSex} = 'M'
OR
(ToNumber({@Age}) in (7 to 18)) and {SB1001_main.PatientSex} = 'F'