Date interval (1 Viewer)

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:27
Joined
May 7, 2009
Messages
19,234
also made a db, without the need of another table that you enter those extra long dates.
 

Attachments

  • CountPatients.zip
    44.5 KB · Views: 47
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:27
Joined
Feb 19, 2002
Messages
43,263
Although there is something to be said for not having to maintain the date table, you need to weigh the cost.
1. Update the date table once per year. You can certainly create code to do that. You can even automate the process so that the first person who opens the app in November, generates the records for the upcoming year.
2. Every person who runs this query has to regenerate the same records over and over again. Depending on the application, different users could do this dozens of times per day. This leads to bloat and forces the user to either use compact on close (not usually recommended) or remember to do it manually. And then there is the issue of overhead when you have to generate more than a couple of hundred records in the date table.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:27
Joined
May 7, 2009
Messages
19,234
to take care of bloat issue, I added another Boolean field to table tblDummy. Records will no longer be deleted, but instead set this field to True. added criteria to the query to include only records where this flag field set.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:27
Joined
May 7, 2009
Messages
19,234
another revision, the query now will not count if the person is discharged on same date as [end date] parameter.
 

Attachments

  • Capture_2019_08_05_565.png
    Capture_2019_08_05_565.png
    47.2 KB · Views: 44
  • CountPatients.zip
    44.6 KB · Views: 51
Last edited:

Users who are viewing this thread

Top Bottom