Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Calculation (Access 97)

    I have been asked to develop a database (in Access 97) to track patients served by our organization. I was hoping that someone could assist me with a problem that I have encountered. I am attempting to have a query calculate the number of days that the patient was served from their date of admission or last billing date, to the now current billing date. I have formatted the date field in the table as test with an input mask of

  2. #2
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculation (Access 97)

    I believe the DateDiff() function should fulfill your needs. Take a look a the online help - it's fairly straightforward. You could use ti in a calculated field in a query. In the field row you would enter an expression similar to this one:

    Days Served: DateDiff("d", Date1, Date2)

    You can then use the calculated field as the control source of a form control.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Date Calculation (Access 97)

    Is the field a date/time field or is it a text field with a date/time input mask? If the field is text, you'll need to make sure you use a CDate() function to convert it to a date before you start trying to do datemath on it.
    Charlotte

  4. #4
    New Lounger
    Join Date
    Jan 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculation (Access 97)

    Charlotte,
    Thank you for your advice.
    John

  5. #5
    New Lounger
    Join Date
    Jan 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculation (Access 97)

    Paul,
    Thank you for your advice.
    John

Posting Permissions

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