I have a query that produce this date:
CYCLEDATE POINT ACTUAL_PCT
2010-09-20 03:00:00.000 0.147 0
2010-09-20 04:00:00.000 0.147 0
2010-09-20 09:00:00.000 0.333 0
2010-09-20 10:00:00.000 0.333 0
2010-09-20 11:00:00.000 0.333 0
2010-09-20 23:00:00.000 0.778 0
2010-09-21 00:00:00.000 0.778 1
2010-09-21 01:00:00.000 0.778 1
2010-09-21 02:00:00.000 1.019 1
2010-09-21 03:00:00.000 1.019 1
In my select I have this:
It produces an error "CYCLEDATE" is not being used in the group by.
However before this it was producing errors
So I put this at the top
My question. How do I group by two columns so that the date looks like this:
CYCLEDATE POINT ACTUAL_PCT
2010-09-20 03:00:00.000 0.147 0
2010-09-20 09:00:00.000 0.333 0
2010-09-20 23:00:00.000 0.778 0
2010-09-21 00:00:00.000 0.778 1
2010-09-21 02:00:00.000 1.019 1
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
CYCLEDATE POINT ACTUAL_PCT
2010-09-20 03:00:00.000 0.147 0
2010-09-20 04:00:00.000 0.147 0
2010-09-20 09:00:00.000 0.333 0
2010-09-20 10:00:00.000 0.333 0
2010-09-20 11:00:00.000 0.333 0
2010-09-20 23:00:00.000 0.778 0
2010-09-21 00:00:00.000 0.778 1
2010-09-21 01:00:00.000 0.778 1
2010-09-21 02:00:00.000 1.019 1
2010-09-21 03:00:00.000 1.019 1
In my select I have this:
Code:
SELECT MIN(CYCLEDATE) as 'Date', POINT AS 'Projected %', ACTUAL_PCT as 'Actual %'
FROM #PROJECTED_CURVE, SQA_DASH_PROJECTED_CURVE WITH (NOLOCK)
WHERE #PROJECTED_CURVE.DURATION_PCT = SQA_DASH_PROJECTED_CURVE.[ORDER]
GROUP BY POINT, ACTUAL_PCT
ORDER BY CYCLEDATE
It produces an error "CYCLEDATE" is not being used in the group by.
However before this it was producing errors
Warning: Null value is eliminated by an aggregate or other SET operation.
So I put this at the top
Code:
SET ANSI_WARNINGS OFF
My question. How do I group by two columns so that the date looks like this:
CYCLEDATE POINT ACTUAL_PCT
2010-09-20 03:00:00.000 0.147 0
2010-09-20 09:00:00.000 0.333 0
2010-09-20 23:00:00.000 0.778 0
2010-09-21 00:00:00.000 0.778 1
2010-09-21 02:00:00.000 1.019 1
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008