473,503 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

number of active customers per period

My database of customers has customers with begin_date and end_date.
Each year has 13 periods (each 4 weeks begins a new period).
I have a problem with calculating number of active customers per
periods, 13 of them.
For example:
If begin_date of customer A is 02-01-07 and end_date is not filled in
the customer should be counted as active till today (19-03-2007) which
means that he should be counted as active in the periods 01, 02, 03 if
I run a query today. When eind_date is filled in the customer should
not appear as active in a period of eind_date.

I hope that somebody can help me with this one?!!!
Any help will be highly appreciated. Thanks in advance!

Haan

Mar 19 '07 #1
2 1683
On Mar 19, 2:52 pm, "van_haan" <vanH...@gmail.comwrote:
My database of customers has customers with begin_date and end_date.
Each year has 13 periods (each 4 weeks begins a new period).
I have a problem with calculating number of active customers per
periods, 13 of them.
For example:
If begin_date of customer A is 02-01-07 and end_date is not filled in
the customer should be counted as active till today (19-03-2007) which
means that he should be counted as active in the periods 01, 02, 03 if
I run a query today. When eind_date is filled in the customer should
not appear as active in a period of eind_date.

I hope that somebody can help me with this one?!!!
Any help will be highly appreciated. Thanks in advance!

Haan
One way to do this is to create a table with the first and last dates
for the 13 periods. Then create a query and have the two tables (your
orginal and the new one with the period range). For the end date,
there are several ways to handle, but you can specify the end date
exactly as you stated above via the nz function (e.g.
LastDate:nz([End_Date],Date())). With that you can check that the
customer begin and end dates are in the range.

Hope this is enough for you.

-- Larry

Mar 20 '07 #2
On Mar 20, 3:28 am, eng...@ridesoft.com wrote:
On Mar 19, 2:52 pm, "van_haan" <vanH...@gmail.comwrote:
My database of customers has customers with begin_date and end_date.
Each year has 13 periods (each 4 weeks begins a new period).
I have a problem with calculating number of active customers per
periods, 13 of them.
For example:
If begin_date of customer A is 02-01-07 and end_date is not filled in
the customer should be counted as active till today (19-03-2007) which
means that he should be counted as active in the periods 01, 02, 03 if
I run a query today. When eind_date is filled in the customer should
not appear as active in a period of eind_date.
I hope that somebody can help me with this one?!!!
Any help will be highly appreciated. Thanks in advance!
Haan

One way to do this is to create a table with the first and last dates
for the 13 periods. Then create a query and have the two tables (your
orginal and the new one with the period range). For the end date,
there are several ways to handle, but you can specify the end date
exactly as you stated above via the nz function (e.g.
LastDate:nz([End_Date],Date())). With that you can check that the
customer begin and end dates are in the range.

Hope this is enough for you.

-- Larry
Thanks Larry!

Mar 20 '07 #3

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

Similar topics

36
3832
by: Peter Brause | last post by:
Hello, my stylesheet shows different colors for visited, active and hovered links. It works fine in IE 6, but in Opera 7 the color for the active link (red background) is never shown. How to...
0
1582
by: Pierre Mengal | last post by:
Active Up is pleased to announce the release of 3 new products. All these products are now part of the Web.Controls Suite . The products featured in the package are: Active Image ..NET...
3
11780
by: Meinia | last post by:
I'm developing a Access DB which will replace Quickbooks for about 60 customers. This involves about 36,000 - 40,000 trasaction per year. Is there a limit to the number of records (rows) that a...
10
1672
by: HK | last post by:
With VB.NET 2005, and a Windows Form, running on a dual CPU box, I need to take a recordset (e.g. 100,000 records) and spawn a thread to handle an internet XML transaction routine for each of the...
5
2472
by: Phil Latio | last post by:
I have 2 virtually identical tables and wish to move data between them. Basically one table is called "live_table" and the other is named "suspended_table" and the only difference is that the...
0
1525
by: fblake | last post by:
Brussels, Belgium and Sunnyvale, Calif., – July 2007 – Active Up today announced today that it has entered into an agreement with Commtouch® (NASDAQ:CTCH) to license Anti-Spam and...
20
27058
by: sesling | last post by:
We have a query that calculates the percentage of customers we have in three groups. (Active, Inactive, Pending). The table we get the precentages from has over 1 million records. I need to...
14
19005
by: Tommy Jakobsen | last post by:
Hi. Is there a method in .NET that takes "year" as an argument and returns the total number of weeks in that year? For culture da-DK (Danish). Thanks in advance. Tommy.
8
4708
by: remlostime | last post by:
i use g++ to generater rand number, now i find that the RAND_MAX is 32367 in my computer, how can i make a bigger rand number( the number is wihin in the integer(2^32-1))
0
7205
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,...
0
7093
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
7287
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
7349
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...
1
7008
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
4688
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
1521
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
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.