473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Calculate by Date (non date fields)

I am calculating actual costs against a budget and have stumbled upon
a problem. For estimating each months hours i have setup text fields
for our Program Managers(PM) to put in approximate hours to complete a
task. So I have a fields called Jan; Feb; Mar; .... These fields are
a bucket to hold estimated hours.
But if I want to compare the actuals to the budget as of this month
how do i do that. So since it is November right now I want to compare
actuals from Jan-Nov and also add up the totals of estimates from
Jan-Nov. However when December rolls around I want it to
automatically calculate from Jan - Dec.

Any ideas?
Thanks
KO
Nov 13 '05 #1
1 1294
turtle wrote:
I am calculating actual costs against a budget and have stumbled upon
a problem. For estimating each months hours i have setup text fields
for our Program Managers(PM) to put in approximate hours to complete a
task. So I have a fields called Jan; Feb; Mar; .... These fields are
a bucket to hold estimated hours.
But if I want to compare the actuals to the budget as of this month
how do i do that. So since it is November right now I want to compare
actuals from Jan-Nov and also add up the totals of estimates from
Jan-Nov. However when December rolls around I want it to
automatically calculate from Jan - Dec.

Any ideas?
Thanks
KO


You could create a function. Pass the ID and month of the function. Ex:

Function SumBudget(lngID As Long, intMonth As integer) As Long
Dim i As Integer
Dim s As String
DIm rst as recordset
set rst = currentdb.openrecordset("Table"...)
rst.findfirst "Id = " & lngID

For i = 1 to intMonth
'get the 3 char abbreviation for the month
s = format(dateserial(Year(date()),i,1),"mmm")
SumBudget = SumBudget + NZ(rst(s),0)
next i
end function

This does not do any checking for years etc. But in a query you could
call this function (modified to your needs) in a column.
BudgetHours : SumBudget([ID],[MonthToPass])

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jason | last post by:
Hi - this post overlaps with another post (Tom K was helping) but has a differnt slant and explanation which I feel warrants a new post..... If one has a series of price reduction fields (3) and...
5
by: SimonC | last post by:
Help needed for a Javascript beginner. As above in the subject... i need a javascript to run this, but not in the form of a web-page. I want to calculate it between 2 fields in a database that...
4
by: Jan Szymczuk | last post by:
I'm creating an MS Access 2000 database where I have a number of people entered using simple basic fields, Surname: SMITH Forenames: John DoB: 09/09/1958 Age:...
3
by: dmkeith2 | last post by:
I'm in the military. I must create a report to track the number of personnel assigned. I have an Authorization table that has a Position. Each of these positions could be authorized any number...
11
by: Laery | last post by:
Hi, I'm currently adding a new module to an old borland C3.1 application (dos). And I need to calculate a date by subtracting the number of days from a given date. I know I could use an...
5
by: milan.letic | last post by:
Hello, I believe that this has been answered somewhere but I cannot find it. I have 51 textboxes on page. In 50 I can enter value. 51st should tell me what is average of entered numbers. As...
6
by: rohayre | last post by:
Im a long time java developer and actually have never done anything with java scripting. I'd like to write a short simple script for calculating a date in the future based on today's date and a...
2
by: martin77 | last post by:
Here is what I have for the code keep getting error on 'declare variables and assign address to object variables Dim strId As String, strPayment As String, curPayment As Currency ...
5
FishVal
by: FishVal | last post by:
IMHO, the following is not a how-to-do instruction to solve a particular problem but more a concept-proof stuff demonstrating possibilities of SQL. So, let us say the problem is to calculate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.