Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Anders Altberg
 To: Nandkishor Lande
  Where is Nandkishor Lande?
 Nandkishor Lande
Subject: RE: Half Month Calculation
Thread ID: 310783 Message ID: 310788 # Views: 40 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Friday, June 24, 2011 12:30:25 PM         

> I Have a question
> i have record of one month
> i want to calculate in two part
> 1 to 15 .and. 16 to 30
> i using this code to
> select * from trans where between(date,dt1,dt2) order by date into cursor x
> &&I want query to all records how to part month in half
> some months have 30 days some months have 31 days and february have 28/29 days how to do it

Is this a different month than thread 310784?

SELECT MONTH(date),DAY(month)<=15, SUM(amount) FROM Mytable ;
 GROUP BY 1,2 

If you use a datetime instead of a date you can split it right down to the second.



Half Month Calculation Posted by Nandkishor Lande @ 6/24/2011 12:02:10 PM
RE: Half Month Calculation Posted by Anders Altberg @ 6/24/2011 12:30:25 PM
RE: Half Month Calculation Posted by Mike Yearwood @ 6/25/2011 6:53:32 PM