Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Nov 2003
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculating Days (Access 97)

    If I have an "ContactId" field, an "AdmissionDate" field and an "DepartureDate" field, with dates input throughout this century, how do I get a total of days only between 01/01/1998 and 31/12/2002 to be added? I.e. if I had a patient with an Admission date of 01/01/1997 and a departure date of 31/12/2001 I'd like it to calculate between 01/01/1998 and 31/12/2001 etc.

    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calculating Days (Access 97)

    You can use expressions with IIf to do this:

    IIf([DepartureDate]>#31/12/2002#,#31/12/2002#,[DepartureDate])-IIf([AdmissionDate]<#01/01/1998#,#01/01/1998#,[AdmissionDate])

    (assuming a system date setting dd/mm/yyyy)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •