How to calculate days worked from start date

I am trying to write a query to work out the number of days my employees have worked since they started at the company and for the report have a column named DaysEmployed.

Any help would be greatly appreciated.
Gary ChalmersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Do you want to work from a rule, such as counting all the days, subtracting weekends and bank holidays, or do you have attendance records in your database?
Gary ChalmersAuthor Commented:
Hi Graham. No requirement to subtract weekends and bank holidays. it is literally just to have a list of the employees and number of days the have been with the company
Fabrice LambertConsultingCommented:

Assuming you have a table named Employee, with at least 3 fields: EmployeeName, Start, End.
you can write query as follow:
SELECT	Employee.EmployeeName,
		DateDiff("d", [start], iif(isNull([end]), now, [End])) AS DaysEmployed
FROM	Employee;

Open in new window

Adjust as needed for your database;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
Try this.
Gary ChalmersAuthor Commented:
Thanks Fabrice
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.