data intervals query

endri81

Registered User.
Local time
Today, 10:02
Joined
Jul 5, 2010
Messages
121
Hi
I have a table like below :
ID BeginDate EndDate Product1 Product2 Product 3
1 1/1/2000 31/3/2000 100 100 100
2 1/6/2000 31/9/2000 100 100 100
.....
I have to compute totals of products for periods of 6 months (fiscal half-year)
How to make this possible?
Regards
 
When you have product1, product2, product3... it is a sign that your tables are not structured properly.

Sounds like, and I'm guessing because you have not given details, your are dealing with various products and you are taking some inventory every so many months.


Consider a table Stock (name it as you wish)
Product .........Product1
StockOnHand .... 120
StockDate........ 1/6/2010
 
This is also the third post from you asking exactly the same question, I know I responded to at least one of them with a method to group your data into first half and second half of a year.
 
but anyway - have a look at the little known, but very useful "partition" function.

does what you want.
 

Users who are viewing this thread

Back
Top Bottom