Viewing 15 posts - 1 through 15 (of 21 total)
Thanks so much, that did the job very well.
August 1, 2012 at 10:09 am
To make it easy then, I will say amt is amount, acc is an account, smp is a sample, and regn is a region. The table His is for history,...
August 1, 2012 at 9:08 am
I have corrected the errors and even tested it
August 1, 2012 at 6:53 am
Hi all.
Sorry for the errors, I have corrected them now in this.
CREATE TABLE Regns
(
sn INT NOT NULL
...
August 1, 2012 at 3:23 am
Sorry for the errors.
SET IDENTITY_INSERT Regns ON
INSERT INTO Regns (sn,Regn)
SELECT '1','La' UNION ALL
SELECT '2','Be' UNION ALL
SELECT '3','Ib' UNION ALL
SELECT '4','En'
SET IDENTITY_INSERT Regns ON
SET IDENTITY_INSERT PJs ON
INSERT INTO PJs (sn,acc,pj)
SELECT...
July 31, 2012 at 10:30 am
Hi Ten centuries,
The query you wrote did worked. But if i try extend it for week=6 and 8, it didn't. But the one ChrisM wrote did what i wanted even...
April 25, 2012 at 7:36 am
Thanks for that, but it will not solve it. I'll explain again.
For each of the resp_Id, i want a count on each brand (that the resp_Id has) in this way....
April 25, 2012 at 6:30 am
Hi,
I think we can proceed with this.
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#mytable','U') IS NOT NULL
...
April 25, 2012 at 3:28 am
Hi,
I will reduce the data to something we can work with, give me a moment to see the sample that can present the possible cases.
Thanks
April 25, 2012 at 2:50 am
Please try these queries.
Select resp_Id,Week,Month,Cat,Brand,Q5
From #mytable
Where Cat=3 and Resp_Id=1002
SELECT resp_Id,Brand, FOP = Count(distinct Q5)
FROM #mytable
WHERE Cat=3 and Respondent_Id=1002
Group by resp_Id,Brand
On executing the two together, there should be 5 rows from...
April 24, 2012 at 10:51 am
If you understand my explanation, then try start with the query i wrote earlier and limit to a resp_Id first and check the output. The output this query gives is...
April 24, 2012 at 10:37 am
Viewing 15 posts - 1 through 15 (of 21 total)