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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate days

Status
Not open for further replies.

lucyc

Programmer
Mar 1, 2002
62
0
0
US
Hi,

I would like to know how to calculate the number of days between 2 admissions. Here is my records look like:

ClientID admissionDate DischargeDate
0001 1/1/2004 1/3/2004
0001 1/4/2004 1/10/2004
0001 1/20/2004

how can I make it looks like:
ClientID admDate DischrgDate Re-admDate #ofdays
0001 1/1/2004 1/3/2004 1/4/2004 1
0001 1/4/2004 1/10/2004 1/20/2004 10

Thanks in advance.
 
Create a formula that subtracts the one date from the other:

//{@#ofdays}

{table.readmitdate} - {table.dischargedate}


When you subtract 2 dates, it will give you the difference in days. If you wanted the difference in another time increment, such as months, years, or hours, you would need to use the DateDiff function.

~Brian
 
Brian,

The re-admitdate is actually the 2nd admission date for this client and it is not on the table. I want to know how to read the 2nd admission date and make a NEW column called re-admdate so I can calculate the duration between the 1st and 2nd admission. Thanks.
 
Never mind, I got it. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top