Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparing two date fields 1

Status
Not open for further replies.

crachic

Technical User
Dec 27, 2007
46
US
I need to write a formula and I am not sure where to start. I need the formula to accomplish the following:

if the admit date of an episode is less than or equal to 7 days after the discharge date of the previous "same type" episode put an X. The discharge date is inclusive, meaning that the discharge date of the previous episode counts as one of the seven.

By "same type" i mean that there are three different types of episodes and the only type I am concerned with it the one where the code is I.

I am using Crystal XI.

Thanks,
-crachic

 
Why not use a record selection so that the only type displayed in the report is "I"? Then assuming an ascending sort on date, you could just use a formula like this:

if {table.patient} = previous({table.patient}) and
datediff("d",previous({table.date}),{table.date}) < 7 then "X"

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top