Calculations

littlelis_19

Registered User.
Local time
Yesterday, 16:27
Joined
Oct 12, 2004
Messages
18
Hi,
Can somebody PLEASE help me.
I am trying to create a staff database whch records Annual leave and Sickness details.
So far I have created a table for "personal details", "Leave", "Sickness" and "Training". I then created a form and used subforms to insert the Annual Leave and Sickness tables.

The problem is, I am trying to create an expression which tells me how many full days people have taken off due to sickness. As I said, I have the table containing the From and To dates and I have a field which indicates the allocated number of days sickness which is allowed. Now I need an expression to put in an unbound text box which calculates the days available minus the dates taken and then gives me the total number of days sickness left. I can then make the box turn red if the person has taken too many days off. (Am I making any sense?) :rolleyes:

PLEASE HELP ME. ive been trying all day and its driving me crazy!!!
 
You can search the forum on date calculation. You will find plenty of samples. Especially in a query forum.

hth,

Michael
 
I've tried this but am still having troubles

Hi,
I've already tried searching the queries forum but I am quite new to access and am still having troubles.
Can you help any more?
 
Try something like this. Make a query with all your fields you wish to have. Make an extra field for expression. Paste the sample below.

DateDiff("y",[DateFieldName1],[DateFieldName2])

DateFieldName1 will subtract from DateFieldName2 and that will give you a total.

hth,

Michael
 
Ive tried this

Hi,
I already have a query which calculates the days:

Days: Sum([Sick Until]-[Sick From])

This give me the total number of days someone is off sick. But now I need to somehow tranfer this into my form. How do I do this?

Sorry to be a pain
Thanks
Lisa
 
Make a blank text box in a Form. Add this formula in the Control Source

=([Sick Until]-[Sick From])

Is that what you're looking for?

Michael
 
This doesnt work

This doesn't work though.

I end up with #Name? in the field box.

AGH!!.....Help me!!!
 
Attached

Hi,
Ive attached my database.

I hope you can help me.

Much Appreciated
 
Try again. There's no attachment. Winzip it than attach the file.

Michael
 

Users who are viewing this thread

Back
Top Bottom