Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,791| Members 17,820, Newest waheguruhelpme| Online 216
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Performing Calculation on Calculation

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
Number Calculation KRDitch Information Technology 2 28-Jul-2006 08:43 AM
Calculation not accepted if value is 0 ktfrubel Information Technology 4 28-Jul-2006 08:29 AM
Time Calculation Jenn Information Technology 4 28-Jul-2006 08:19 AM
Trend Calculation? AirgasRob Information Technology 3 28-Jul-2006 08:12 AM
Little calculation help? DevourU Information Technology 5 28-Oct-2005 18:00 PM


Tags
performing, calculation
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:42 AM
Jennifer Cali's Avatar Jennifer Cali
Guest
 
Posts: n/a
   
   
Performing Calculation on Calculation

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I have a tough situation in a recruiting database
1. A table stores position status (active/closed), location (there are 3
locations), day position became vacant, and day position was filled.
2. A form tied to this query has a calculation in it that determines the
number of days vacant for a position. On the form, each record is
individually displayed and the number of days vacant is autocalc'd by
subtracting dtmDateVacant from dtmDateFilled.
3. I need to create a report showing the average number of days vacant for
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/14052-performing-calculation-on-calculation.html
all active positions by location. So...there are two criteria: (1) must be
active, (2) must be in location A - I'll then repeat this calc for the other
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14052
two locations.

I'm stuck b/c I don't know how to write the statement in the query that
would pull this info. I'm currently using an aggregate function to calc other
info (ex: Sum(IIf(chrMgrType="GMB" And chrArchive="Active" And
chrActualCode="LOA" And (chrZone="Zone 11" Or chrZone="Zone 12"),1,0)) AS
GMB1_LOA), but I don't know how to do it to calculate a field that is already
a calculation itself b/c it's not stored anywhere...


--
Thank you! - Jennifer



 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:42 AM
Ken Sheridan's Avatar Ken Sheridan
Guest
 
Posts: n/a
   
   
RE: Performing Calculation on Calculation

Jennifer:

Two possible approaches:

1. You can return just the Active status rows and do the date arithmetic in
a query and base the report on that. Then do the averaging in the report.
The query would go something like this:

SELECT Location, dtmDateFilled-dtmDateVacant AS DaysVacant
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14052
FROM YourTable
WHERE Satus = "Active";

In the report based on this query group the report on Location in the
sorting and grouping dialogue. Make sure you opt to give the group a group
footer. If you only want to show the averages and no detail rows just leave
the detail section as zero height. In the group footer add a control bound
to the Location field and add an unbound text box with a ControlSource
property of:

=Avg([DaysVacent])

The report will list all locations with the average days vacant for each
whwre the sataus is active. If you want the option of reporting for just one
lovation or for all then add a parameter to the report's query like so:

SELECT Location, dtmDateFilled-dtmDateVacant AS DaysVacant
FROM YourTable
WHERE Status = "Active"
AND (Location = [Enter location (leave blank for all)]
OR [Enter location (leave blank for all)] IS NULL);

This will prompt for a location when the report is opened. If one is
entered the report will show the average for just that location, if its left
blank then all locations will be returned.

2. Alternatively you could do the whole thing in the query and base a
simple report on it:

SELECT Location,
AVG(dtmDateFilled-dtmDateVacant) AS AverageDaysVacant
FROM YourTable
WHERE Status = "Active"
AND (Location = [Enter location (leave blank for all)]
OR [Enter location (leave blank for all)] IS NULL)
GROUP BY Location;

Ken Sheridan
Stafford, England

"Jennifer Cali" wrote:

> I have a tough situation in a recruiting database
> 1. A table stores position status (active/closed), location (there are 3
> locations), day position became vacant, and day position was filled.
> 2. A form tied to this query has a calculation in it that determines the
> number of days vacant for a position. On the form, each record is
> individually displayed and the number of days vacant is autocalc'd by
> subtracting dtmDateVacant from dtmDateFilled.
> 3. I need to create a report showing the average number of days vacant for
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14052
> all active positions by location. So...there are two criteria: (1) must be
> active, (2) must be in location A - I'll then repeat this calc for the other
> two locations.
>
> I'm stuck b/c I don't know how to write the statement in the query that
> would pull this info. I'm currently using an aggregate function to calc other
> info (ex: Sum(IIf(chrMgrType="GMB" And chrArchive="Active" And
> chrActualCode="LOA" And (chrZone="Zone 11" Or chrZone="Zone 12"),1,0)) AS
> GMB1_LOA), but I don't know how to do it to calculate a field that is already
> a calculation itself b/c it's not stored anywhere...
>
>
> --
> Thank you! - Jennifer


Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:42 AM
Nicholajlg's Avatar Nicholajlg
Guest
 
Posts: n/a
   
   
Re: Performing Calculation on Calculation

  Donate Today!  
Hello

Is there a particular reason for using a form for this calculation over
a query? To create this in a query though, is relatively simple. first
calculate the number of days vacant in a query, essentially the same,
you just put Field Name: sum([DateVacant] - [DateFilled]). Include
labels designating as active and the location.

Then build a query off of this one. This time it's easy b/c every time
you enter a field, you can specify what the field should contain in
order for it to be included. ie for Location A, in the field named
Location, type in the name of Location A in the criteria space & the
only thing you'll get is Location A. You can build 3 separate queries
and calculate your averages for each location separately. Or, you can
load just this data into a table and calculate your averages in a query
based on this data. Either way, Putting the data in a table after
separating the three allows them to all be listed separately, in the
same column. The query built off of this table now contains every
piece of data you are looking for - and can be used in any form or
report to show all data together or to filter in any way you like.

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14052
Good Luck!


Jennifer Cali wrote:
> I have a tough situation in a recruiting database
> 1. A table stores position status (active/closed), location (there are 3
> locations), day position became vacant, and day position was filled.
> 2. A form tied to this query has a calculation in it that determines the
> number of days vacant for a position. On the form, each record is
> individually displayed and the number of days vacant is autocalc'd by
> subtracting dtmDateVacant from dtmDateFilled.
> 3. I need to create a report showing the average number of days vacant for
> all active positions by location. So...there are two criteria: (1) must be
> active, (2) must be in location A - I'll then repeat this calc for the other
> two locations.
>
> I'm stuck b/c I don't know how to write the statement in the query that
> would pull this info. I'm currently using an aggregate function to calc other
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14052
> info (ex: Sum(IIf(chrMgrType="GMB" And chrArchive="Active" And
> chrActualCode="LOA" And (chrZone="Zone 11" Or chrZone="Zone 12"),1,0)) AS
> GMB1_LOA), but I don't know how to do it to calculate a field that is already
> a calculation itself b/c it's not stored anywhere...
>
>
> --
> Thank you! - Jennifer


Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism need urgent advice.......
Today 10:03 AM
7 Replies, 87 Views
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 348 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,041 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 53 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 120 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,837 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 230 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 46 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 66 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 47 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 416 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 51 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 10:03 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.41141 seconds with 30 queries