A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

total leave



 
 
Thread Tools Display Modes
  #1  
Old November 17th, 2009, 11:12 AM posted to microsoft.public.access.forms
Tia[_3_]
external usenet poster
 
Posts: 126
Default total leave

DEAR,

i have a table with employee ID name date from, date to, total days,
type of leave"annual, sick"
i have a query for total days
how can i get total annual taken by ID
and total sick taken by ID

ID from Till Total Days Leave Type
5001 1/1/2009 1/5/2009 Annual
5002 1/11/2009 1/20/2009 Sick
5001 1/11/2009 1/20/2009 Annual


Best Regards
  #2  
Old November 17th, 2009, 02:08 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default total leave

On Tue, 17 Nov 2009 03:12:59 -0800 (PST), Tia
wrote:

[Total Days] is a calculated column and does not belong in a
relational database. Rather you should delete this field, and then
create a query on this table with an extra column for [Total Days]
(which I will call TotalDays because I hate these extra brackets) with
an expression to calculate the days:
TotalDays: DateDiff('d', From, Till)

I think "From" may also be a reserved word; let's rename those two
fields to LeaveFrom and LeaveTill
TotalDays: DateDiff('d', LeaveFrom, LeaveTill)

Now you can create a new query based on this query and turn on the
Group By feature with the Sigma button, and group by ID and sum by
TotalDays.

-Tom.
Microsoft Access MVP


DEAR,

i have a table with employee ID name date from, date to, total days,
type of leave"annual, sick"
i have a query for total days
how can i get total annual taken by ID
and total sick taken by ID

ID from Till Total Days Leave Type
5001 1/1/2009 1/5/2009 Annual
5002 1/11/2009 1/20/2009 Sick
5001 1/11/2009 1/20/2009 Annual


Best Regards

  #3  
Old November 17th, 2009, 05:58 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default total leave

Also group by Leave Type.

--
Daryl S


"Tom van Stiphout" wrote:

On Tue, 17 Nov 2009 03:12:59 -0800 (PST), Tia
wrote:

[Total Days] is a calculated column and does not belong in a
relational database. Rather you should delete this field, and then
create a query on this table with an extra column for [Total Days]
(which I will call TotalDays because I hate these extra brackets) with
an expression to calculate the days:
TotalDays: DateDiff('d', From, Till)

I think "From" may also be a reserved word; let's rename those two
fields to LeaveFrom and LeaveTill
TotalDays: DateDiff('d', LeaveFrom, LeaveTill)

Now you can create a new query based on this query and turn on the
Group By feature with the Sigma button, and group by ID and sum by
TotalDays.

-Tom.
Microsoft Access MVP


DEAR,

i have a table with employee ID name date from, date to, total days,
type of leave"annual, sick"
i have a query for total days
how can i get total annual taken by ID
and total sick taken by ID

ID from Till Total Days Leave Type
5001 1/1/2009 1/5/2009 Annual
5002 1/11/2009 1/20/2009 Sick
5001 1/11/2009 1/20/2009 Annual


Best Regards

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.