473,569 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dates and currency

I have a table and a form. I have a weekly cost field and a monthly
cost field and a
projected total field. I have got the monthly cost field to add up the
weekly cost field and now would like the projected total field to add
up the monthly cost field between 2 date fields, the effective start
date and the end date.

Don't know where to start

HELP!

Elaine

Aug 8 '06 #1
2 1173
Hi Elainie,

It strikes me that you want a totals query that will have critera on
the date.

The sql would look something like this.

SELECT Sum(MonthyCost) AS Total
FROM tblCosts
WHERE ExpenseDate [StartDate] and ExpenseDate < [EndDate]

Good luck

Nick
Elainie wrote:
I have a table and a form. I have a weekly cost field and a monthly
cost field and a
projected total field. I have got the monthly cost field to add up the
weekly cost field and now would like the projected total field to add
up the monthly cost field between 2 date fields, the effective start
date and the end date.

Don't know where to start

HELP!

Elaine
Aug 8 '06 #2
So your Monthly Cost field knows which weeks are attributed to your
month? Are you doing this based on dates? Where are the dates stored?
Is your table flat, or do you have multiple relational tables? If
you're not doing this based on dates, are you multiplying the Weekly
Cost field by 4 to assume a Monthly Cost?

I'd say you can enter a start date and end date, use the Week()
function to find out which week number it is (between 1 and 52) and
then subtract it from the end date, but that's not going to work if
your project spans from, say, December 10th to January 20th. You're
probably going to have to do a DateDiff to find out how many days are
between your start and end dates, and then divide that by 7 to get the
number of weeks, and then multiply that by your weekly cost.

Elainie wrote:
I have a table and a form. I have a weekly cost field and a monthly
cost field and a
projected total field. I have got the monthly cost field to add up the
weekly cost field and now would like the projected total field to add
up the monthly cost field between 2 date fields, the effective start
date and the end date.

Don't know where to start

HELP!

Elaine
Aug 8 '06 #3

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

Similar topics

9
2749
by: Thomas W | last post by:
I'm developing a web-application where the user sometimes has to enter dates in plain text, allthough a format may be provided to give clues. On the server side this piece of text has to be parsed into a datetime python-object. Does anybody have any pointers on this? Besides the actual parsing, my main concern is the different locale date...
2
574
by: Willing 2 Learn | last post by:
I'm still having trouble getting my program to do arithmetic in cents(keeping all #'s) then convert the answer in a format of dollars & cents. The main program should add, subtract, scalar multiply(by int)& show, have a constructor w/ & w/out arguments. Header file should have private data & all 6 functions from above.Class definition file...
1
1485
by: Michael | last post by:
Hi everyone. Thanks again in advance for any help I can get. I am running a function that runs a query and exports it to excel using DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "stoEstMax", "d:\database\STOstats.xls"
3
2484
by: thechaosengine | last post by:
Hi all, I'm having trouble getting dates to display in the right format in my GridView. I'd like it to appear in the UK format - just the date, not the time, but I'm not having any luck. Someone suggested i try DataFormatString="{0:dd-mm-yyyy}" on the appropriate column however that still outputs 24/04/2006 00:00:00
6
1519
by: thechaosengine | last post by:
Hi guys, I'm developing a web app on a UK computer. When I put a date into a textbox, its in the format DD/MM/YY. The DateTime object takes that in and handles in perfectly. Now, I need to start using the american format MM/DD/YY. My question is, how do I get the DateTime object to recognise what I'm passing in as an American date? If...
8
294
by: Phil Stanton | last post by:
I am being thick. I have a table of employees - EmpID & EmpName I have a table or wage rates for each employee - RateID, EmpID, WageRate RateFron (Date) I have a table of payments - PayID, EmpID PayAmount, DatePaid how on earth do I do a query to give me EmpName, DatePaid, HoursWorked. The Hours worked is calculated from the PayAmont and...
16
9485
by: xjohnx | last post by:
Hi, I'm hoping someone can help me I am quite new to Javascript and have had to create a programme which converts dollars into euros and vice versa, here is my script which is working var currency; var amountEntered; currency = window.prompt('Please enter 0 to convert from Dollars to euros and 1 to convert form euros to dollars',''); ...
4
1496
lee123
by: lee123 | last post by:
hi there it's been awhile since i have been on this forum but anyway how do you calculate dates in a query so that there are in currency for example: if a person rents a room from 01/01/07 to 01/01/08 or 01/01/07 to 06/01/07 how would i get the total amount due if the rent was $540.00 in a query. lee123
1
2323
by: Malcolm Greene | last post by:
The locale module provides the ability to format dates, currency and numbers according to a specific locale. Is there a corresponding module for parsing locale's output to convert locale formatted dates, currency, and numbers back to their native data types on the basis of a specified locale? In other words, a module that will reverse the...
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6278
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.