Avatar of arul mozhi
arul mozhi
 asked on

how to make calender for 365 days

I am a beginner in MS Access and using MS Access 2000. I have slowly and consistently learning the correct ways from the people like you. Now, for one of my database on Workers/Staffs Attendance, I need to fill one of a field with date from 1 Jan XXXX (now 2017) to 31 Dec XXXX.

....so on..

I need help to create query to automatically fill that filed with continuous date and next field with weekdays (sunday, monday..etc).
Please help me with sample coding and if any other easy steps are there, then let me know.

Microsoft Access

Avatar of undefined
Last Comment

8/22/2022 - Mon
Jim Dettman (EE MVE)


  Usually pre-filling a table with records is a bad idea.   If your tracking attendance, you would simply record what days they attended.  Then when reporting, figure out if they had a day for that record or not.

Rey Obrero (Capricorn1)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

I agree with Jim.  It doesn't make any sense to prefill a table with empty attendance records.  it is especially bad when you know that at least 25% of them will NEVER be used.  Why put in a record for every day of the month when people only work 5 days a week.

The example Rey posted was simplistic and it just adds one record per day for a whole year.  What you are asking to do I believe would be to generate a month's worth of records for EACH worker.  That is still poor practice.  However, if you have a schedule table so you can identify which week days a person generally works, there is some logic (but not much) to pre-generating those records.  So if Sallie works mon-fri, you could generate an empty attendance record for those five days for all occurrences in a month.  Or Sam works weekends and holidays so the code would generate Sat and Sun records for Sam for a month but there would also need to be a holiday table available to include holidays and by extension, exclude them from the standard record generation.

In general, it is far better to add the records as needed.  That way you don't clutter up the database with records that are never relevant.
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Gustav Brock

Question was fully answered.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

Swell.  Every time Suzie, Sam, and the other 50 staff members login, they'll all add the same useless records; probably multiple times each day if this is a form they go to multiple times.  Hope this user knows enough to add a primary key or unique index to the table or it's going to grow like wildfire.  But the question was "fully" answered.