date functions

  • Thread starter Thread starter Mitchell_Collen via AccessMonster.com
  • Start date Start date
M

Mitchell_Collen via AccessMonster.com

Does anybody know how to calculate dates? I believe that it can be done
however, I am not sure where to start.

I have admit date and discharge date on several hundred records. I need to
get the number of days between admit date and discharge date per record_id.

Select admit_date, discharge_date and record_id, (convert(admit_date) +
convert(disharge_date)) As number_days
From subject
group by record_id;

This is not working. I believe that I am going about this totally wrong
according to the error messages generaed.

Any advice is welcome and appreciated.

Thanks, Mitchell
 
Mitchell_Collen via AccessMonster.com said:
Does anybody know how to calculate dates? I believe that it can be
done however, I am not sure where to start.

I have admit date and discharge date on several hundred records. I
need to get the number of days between admit date and discharge date
per record_id.

Select admit_date, discharge_date and record_id, (convert(admit_date)
+ convert(disharge_date)) As number_days
From subject
group by record_id;

This is not working. I believe that I am going about this totally
wrong according to the error messages generaed.

Any advice is welcome and appreciated.

Thanks, Mitchell

There is a function named DateDiff(). In your case...

DateDiff("d", admit_date, disharge_date)
 
Rick said:
Does anybody know how to calculate dates? I believe that it can be
done however, I am not sure where to start.
[quoted text clipped - 14 lines]
Thanks, Mitchell

There is a function named DateDiff(). In your case...

DateDiff("d", admit_date, disharge_date)
Thanks so much. I wasn't sure of the correct way to use that.
 
Back
Top