MS SQL SERVER:
id, customerid, serv-start-date, service-end-date, charge
1, A1, 1-1-14 , 1-5-14 , $200
2, A1, 1-6-14 , 1-8-14 , $300
3, A1, 2-1-14 , 2-1-14 , $100
4, A2, 2-1-14 , 2-1-14 , $100
5, A2, 2-3-14 , 2-5-14 , $100
6, A2, 2-6-14 , 2-8-14 , $100
7, A1, 1-9-14 , 1-12-14 , $100
*ID - unique field
What i need :
Basically to see the maximum total consecutive days Service start date and end date.
for customer A1 it would be 11 days (1-5 plus 6-8 plus 9-12) and customer A2 it would be 5 6 days (3-5 plus 6-8) ... (claimid is unique PK).
tag each record so 1,2,3 so we know which records are connected to each other ... So for Cust A1 which Claim ids are selected and enumerate them.
Hi!
My name is Clayton, and I would love to help you with this. I see you need an MS SQL query to list the max number of consecutive days a customer uses your service. You need the query to add days across claims as long as they are consecutive and list out the Claim IDs used in the calculation. I can definitely provide you with this within a day of acceptance.
I am Microsoft Certified in SQL Server Business Intelligence Development and have over 4 years in direct SQL Server experience. Please let me know if you have any questions. I look forward to the opportunity to work with you and provide you excellent service.
Thank you,
Clayton E. Tillman, M.S.
CEO - Noesis Software Solutions, Inc.
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
2 freelancers están ofertando un promedio de $46 USD por este trabajo