We help IT Professionals succeed at work.

how to make calender for 365 days

arul mozhi
arul mozhi asked
on
55 Views
Last Modified: 2017-03-28
Hi!
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.
example:  
1-jan-2017
2-jan-2017
3-jan-2017

....so on..
31-jan-2017

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.
thanx.

Arul
Comment
Watch Question

Jim Dettman (EE MVE)President / Owner
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017

Commented:
Arul,

  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.

Jim.
CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
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.
CERTIFIED EXPERT
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
Question was fully answered.
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
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.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions