473,511 Members | 15,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculate by months

Can anyone point me in the right direction please

I have a table with the following fields [BeginDate], Enddate], [Rate]
in dollars) and [NoOfNights] in an Accommodation db.

I would like to get a total for each month, however some of the start
and end dates of the bookings begin in one month and end in the
month(s) following. How do I sort out the problem

TIA

May 6 '07 #1
3 1824
I think you need to create a table that updates when you use your table you
mention below, you need it to have each individual day and the rate listed
that way you could easily calculate out your monthly rates. You could have
these second table auto populate using code. I don't think there is anyway
to do it with your current set up, atleast not easily.

"Chesne" <as******@paradise.net.nzwrote in message
news:11*********************@u30g2000hsc.googlegro ups.com...
Can anyone point me in the right direction please

I have a table with the following fields [BeginDate], Enddate], [Rate]
in dollars) and [NoOfNights] in an Accommodation db.

I would like to get a total for each month, however some of the start
and end dates of the bookings begin in one month and end in the
month(s) following. How do I sort out the problem

TIA

May 6 '07 #2
Chesne <as******@paradise.net.nzwrote in
news:11*********************@u30g2000hsc.googlegro ups.com:
Can anyone point me in the right direction please

I have a table with the following fields [BeginDate],
Enddate], [Rate] in dollars) and [NoOfNights] in an
Accommodation db.

I would like to get a total for each month, however some of
the start and end dates of the bookings begin in one month and
end in the month(s) following. How do I sort out the problem

TIA
You can calculate the number of days from the start date to the
end of the month. You can also do the first of the (next) month
to the endDate.

This has a problem if the stay starts 31st of march and runs to
1st of may.
..
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

May 6 '07 #3
On May 6, 5:32 am, Chesne <ashfi...@paradise.net.nzwrote:
Can anyone point me in the right direction please

I have a table with the following fields [BeginDate], Enddate], [Rate]
in dollars) and [NoOfNights] in an Accommodation db.

I would like to get a total for each month, however some of the start
and end dates of the bookings begin in one month and end in the
month(s) following. How do I sort out the problem

TIA
I see that you've been working on this problem for over two years:

http://groups.google.com/group/comp....fcbcf1c83ddd11

I use the DateIntersection function to help me get started with the
logic for the SQL statement. Once the SQL statement is providing
correct answers it is often feasible to replace the DateIntersection
function with a subquery or a join thereby eliminating dependence on
VBA.

James A. Fortune
CD********@FortuneJames.com

May 7 '07 #4

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

Similar topics

13
3905
by: David Gray | last post by:
Greetings all, Quick newbie type question: I would like to be able to trap non-numerical data entered into a textbox via CTRL+C and/or Shift+Insert. I realise that this data can be...
1
6070
by: bin_P19 P | last post by:
the code i have got is as follows and now im stuck <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Shopping...
6
27935
by: carl.barrett | last post by:
Hi, I have a continuous form based on a query ( I will also be creating a report based on the same query). There are 2 fields: Date Obtained and Date Of Expiry I want a further 3 columns...
6
31768
by: charliewest | last post by:
Can someone pls point me to or recommend the easiest way to calculate someone´s age using the TimeSpan object, in .NET CF? Isn´t there a simple way to use the TimeSpan object to calculate the...
0
1033
by: p dietz | last post by:
Hello in a edittemplate of a datalist i want to use rangevalidators (for date e.g.), but these rangevalidators min and max values must be dependent on the value to edit (e.g. if the date to edit is...
4
22600
by: kux | last post by:
Hello everyone, I hope someone is out here who can help me with a simple calculation... I have a sales data base in access with monthly sales history by product. to make future predictions I...
6
14431
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...
1
2077
by: Karen Price | last post by:
I am trying to calculate dates by having a beginning date and adding the applicable number of months and coming up with a new date. EX: Original Date = 06/09/06 and need to add three months to...
4
6865
by: MCLR | last post by:
Good day to all: I found your website a couple of days ago as I was searching for resources that can help within my particular problem in writing a script for an Access Query. The issue is to...
5
19798
by: Mike | last post by:
I use c#, V2005 How I can get difference between two dates and get value in month(s) I had found some solutions but it is not exactly what I need. private static int...
0
7153
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
7371
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,...
1
7093
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
5676
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,...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
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...
0
3230
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...
0
1583
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 ...
1
791
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.