Click here to Skip to main content
15,999,481 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear Techie, this is my requirement, thanks for your support and effort
TaskName StartDate FinishDate Amount
Product-1 01/03/2018 15/02/2020 75000
Product-2 01/03/2018 15/02/2023 50000
Product-3 01/03/2018 29/03/2019 25000
Product-4 01/03/2019 25/03/2020 10000
Product-5 01/01/2020 15/02/2023 15000

My Output like this
Perpoduct and StartDate,FinishDate Month wise amount will split
Like
Product-1 March-18 6250.00
April-18 4166.67
May-18 2083.33
June-18 833.33
July-18 1250.00
August-18 0.00
September-18 0.00
upto-Last Finishdate 0.00
Product-2 Same above

What I have tried:

My code is not much
Dear Techie, this is my requirement, thanks for your support and effort
TaskName	StartDate	FinishDate	Amount
Product-1	01/03/2018	15/02/2020	75000
Product-2	01/03/2018	15/02/2023	50000
Product-3	01/03/2018	29/03/2019	25000
Product-4	01/03/2019	25/03/2020	10000
Product-5	01/01/2020	15/02/2023	15000
			
My Output like this			
Perpoduct and StartDate,FinishDate Month wise amount will split			
Like			
Product-1	March-18	6250.00	
	April-18	4166.67	
	May-18	2083.33	
	June-18	833.33	
	July-18	1250.00	
	August-18	0.00	
	September-18	0.00	
	upto-Last Finishdate	0.00	
Product-2	Same above		
Posted
Updated 15-Dec-19 23:36pm
Comments
Maciej Los 16-Dec-19 4:36am    
What's your problem?
Note: we can't read in your mind or direct from your screen. So, you have to describe your issue and provide the examples to explain what you want to achieve.

Try using GROUP BY.
Something like:
SQL
SELECT ProductName, MIN(EnterDate), MAX(EnterDate), SUM(Amount)
FROM MyTable
GROUP BY ProductName
 
Share this answer
 
Thanks, but my requirement is StartDate, FinishDate breakups
like Monthwise, Amount

Thanks
 
Share this answer
 
Comments
Maciej Los 16-Dec-19 5:55am    
This is not an answer. Please, delete it to avoid down-voting. To post comment, use "Have a question or comment" widget under the solution you want to post a comment.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900