Let's say I have three cascading parameters. I make the selections in
P1, P2, P3. Now I change the selection in P2 in the next round.
Is there a way to 'remember' the previously selected parameter value -
somewhere... anywhere...'No responses... so I guess this is not possible.
Or is it because no one understood my question?
I want to somehow 'hold' the value of the selected parameter. And when
the user changes the parameter, I just want to be able to refrence his
previous selection.
Do I do this with another report behind the scenes?|||If you are still asking. The question is do you want a default or just the
user selection to stay?
"Harsh" wrote:
> No responses... so I guess this is not possible.
> Or is it because no one understood my question?
> I want to somehow 'hold' the value of the selected parameter. And when
> the user changes the parameter, I just want to be able to refrence his
> previous selection.
> Do I do this with another report behind the scenes?
>
Showing posts with label sets. Show all posts
Showing posts with label sets. Show all posts
Wednesday, March 7, 2012
Tuesday, February 21, 2012
Repost
I have a need to update data in a table so that
a column contains the generated number for sets of records
for instance I have fileName as listed and it should
generate the SheetNum for each of the set
FileName SheetNum
A001 1
A001 2
A002 1
A002 2
A002 3
A003 1
A003 2
B011 1
B011 2
B011 3
C189 1
D9090 1
Thank you in advance
-Kamy
..
Kamy,
This will do it at least as you specified.
SET NOCOUNT ON
GO
IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
GO
CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
GO
INSERT test VALUES ('A001',0)
INSERT test VALUES ('A001',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A003',0)
INSERT test VALUES ('A003',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('C189',0)
INSERT test VALUES ('D9090',0)
GO
ALTER TABLE dbo.test add Ctr int not null identity(1,1)
GO
SELECT t1.TestCol
, (SELECT COUNT(*) FROM test t2 WHERE t1.testcol = t2.testcol AND t1.Ctr
>= t2.Ctr)
FROM test t1
GO
ALTER TABLE dto.test DROP COLUMN Ctr
Hope this helps,
Ron
Ron Talmage
SQL Server MVP
"Kamy" <anonymous@.discussions.microsoft.com> wrote in message
news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
> I have a need to update data in a table so that
> a column contains the generated number for sets of records
> for instance I have fileName as listed and it should
> generate the SheetNum for each of the set
> FileName SheetNum
> A001 1
> A001 2
> A002 1
> A002 2
> A002 3
> A003 1
> A003 2
> B011 1
> B011 2
> B011 3
> C189 1
> D9090 1
> Thank you in advance
> -Kamy
> .
>
|||Thank you Ron,
I will try it out.
-Kamy
>--Original Message--
>Kamy,
>This will do it at least as you specified.
>SET NOCOUNT ON
>GO
>IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
>GO
>CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
>GO
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('C189',0)
>INSERT test VALUES ('D9090',0)
>GO
>ALTER TABLE dbo.test add Ctr int not null identity(1,1)
>GO
>SELECT t1.TestCol
> , (SELECT COUNT(*) FROM test t2 WHERE t1.testcol =
t2.testcol AND t1.Ctr
>FROM test t1
>GO
>ALTER TABLE dto.test DROP COLUMN Ctr
>Hope this helps,
>Ron
>--
>Ron Talmage
>SQL Server MVP
>"Kamy" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
records
>
>.
>
a column contains the generated number for sets of records
for instance I have fileName as listed and it should
generate the SheetNum for each of the set
FileName SheetNum
A001 1
A001 2
A002 1
A002 2
A002 3
A003 1
A003 2
B011 1
B011 2
B011 3
C189 1
D9090 1
Thank you in advance
-Kamy
..
Kamy,
This will do it at least as you specified.
SET NOCOUNT ON
GO
IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
GO
CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
GO
INSERT test VALUES ('A001',0)
INSERT test VALUES ('A001',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A003',0)
INSERT test VALUES ('A003',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('C189',0)
INSERT test VALUES ('D9090',0)
GO
ALTER TABLE dbo.test add Ctr int not null identity(1,1)
GO
SELECT t1.TestCol
, (SELECT COUNT(*) FROM test t2 WHERE t1.testcol = t2.testcol AND t1.Ctr
>= t2.Ctr)
FROM test t1
GO
ALTER TABLE dto.test DROP COLUMN Ctr
Hope this helps,
Ron
Ron Talmage
SQL Server MVP
"Kamy" <anonymous@.discussions.microsoft.com> wrote in message
news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
> I have a need to update data in a table so that
> a column contains the generated number for sets of records
> for instance I have fileName as listed and it should
> generate the SheetNum for each of the set
> FileName SheetNum
> A001 1
> A001 2
> A002 1
> A002 2
> A002 3
> A003 1
> A003 2
> B011 1
> B011 2
> B011 3
> C189 1
> D9090 1
> Thank you in advance
> -Kamy
> .
>
|||Thank you Ron,
I will try it out.
-Kamy
>--Original Message--
>Kamy,
>This will do it at least as you specified.
>SET NOCOUNT ON
>GO
>IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
>GO
>CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
>GO
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('C189',0)
>INSERT test VALUES ('D9090',0)
>GO
>ALTER TABLE dbo.test add Ctr int not null identity(1,1)
>GO
>SELECT t1.TestCol
> , (SELECT COUNT(*) FROM test t2 WHERE t1.testcol =
t2.testcol AND t1.Ctr
>FROM test t1
>GO
>ALTER TABLE dto.test DROP COLUMN Ctr
>Hope this helps,
>Ron
>--
>Ron Talmage
>SQL Server MVP
>"Kamy" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
records
>
>.
>
Repost
I have a need to update data in a table so that
a column contains the generated number for sets of records
for instance I have fileName as listed and it should
generate the SheetNum for each of the set
FileName SheetNum
A001 1
A001 2
A002 1
A002 2
A002 3
A003 1
A003 2
B011 1
B011 2
B011 3
C189 1
D9090 1
Thank you in advance
-Kamy
.Kamy,
This will do it at least as you specified.
SET NOCOUNT ON
GO
IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
GO
CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
GO
INSERT test VALUES ('A001',0)
INSERT test VALUES ('A001',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A003',0)
INSERT test VALUES ('A003',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('C189',0)
INSERT test VALUES ('D9090',0)
GO
ALTER TABLE dbo.test add Ctr int not null identity(1,1)
GO
SELECT t1.TestCol
, (SELECT COUNT(*) FROM test t2 WHERE t1.testcol = t2.testcol AND t1.Ctr
>= t2.Ctr)
FROM test t1
GO
ALTER TABLE dto.test DROP COLUMN Ctr
Hope this helps,
Ron
--
Ron Talmage
SQL Server MVP
"Kamy" <anonymous@.discussions.microsoft.com> wrote in message
news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
> I have a need to update data in a table so that
> a column contains the generated number for sets of records
> for instance I have fileName as listed and it should
> generate the SheetNum for each of the set
> FileName SheetNum
> A001 1
> A001 2
> A002 1
> A002 2
> A002 3
> A003 1
> A003 2
> B011 1
> B011 2
> B011 3
> C189 1
> D9090 1
> Thank you in advance
> -Kamy
> .
>|||Thank you Ron,
I will try it out.
-Kamy
>--Original Message--
>Kamy,
>This will do it at least as you specified.
>SET NOCOUNT ON
>GO
>IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
>GO
>CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
>GO
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('C189',0)
>INSERT test VALUES ('D9090',0)
>GO
>ALTER TABLE dbo.test add Ctr int not null identity(1,1)
>GO
>SELECT t1.TestCol
> , (SELECT COUNT(*) FROM test t2 WHERE t1.testcol =t2.testcol AND t1.Ctr
>>= t2.Ctr)
>FROM test t1
>GO
>ALTER TABLE dto.test DROP COLUMN Ctr
>Hope this helps,
>Ron
>--
>Ron Talmage
>SQL Server MVP
>"Kamy" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
>> I have a need to update data in a table so that
>> a column contains the generated number for sets of
records
>> for instance I have fileName as listed and it should
>> generate the SheetNum for each of the set
>> FileName SheetNum
>> A001 1
>> A001 2
>> A002 1
>> A002 2
>> A002 3
>> A003 1
>> A003 2
>> B011 1
>> B011 2
>> B011 3
>> C189 1
>> D9090 1
>> Thank you in advance
>> -Kamy
>> .
>>
>
>.
>|||hi Ron,
It didn't work, as soon as I add an identity column,
it inserts running nos. into the field.
Am I missing something?
Thank you,
-Kamy
>--Original Message--
>Kamy,
>This will do it at least as you specified.
>SET NOCOUNT ON
>GO
>IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
>GO
>CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
>GO
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('C189',0)
>INSERT test VALUES ('D9090',0)
>GO
>ALTER TABLE dbo.test add Ctr int not null identity(1,1)
>GO
>SELECT t1.TestCol
> , (SELECT COUNT(*) FROM test t2 WHERE t1.testcol =t2.testcol AND t1.Ctr
>>= t2.Ctr)
>FROM test t1
>GO
>ALTER TABLE dto.test DROP COLUMN Ctr
>Hope this helps,
>Ron
>--
>Ron Talmage
>SQL Server MVP
>"Kamy" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
>> I have a need to update data in a table so that
>> a column contains the generated number for sets of
records
>> for instance I have fileName as listed and it should
>> generate the SheetNum for each of the set
>> FileName SheetNum
>> A001 1
>> A001 2
>> A002 1
>> A002 2
>> A002 3
>> A003 1
>> A003 2
>> B011 1
>> B011 2
>> B011 3
>> C189 1
>> D9090 1
>> Thank you in advance
>> -Kamy
>> .
>>
>
>.
>
a column contains the generated number for sets of records
for instance I have fileName as listed and it should
generate the SheetNum for each of the set
FileName SheetNum
A001 1
A001 2
A002 1
A002 2
A002 3
A003 1
A003 2
B011 1
B011 2
B011 3
C189 1
D9090 1
Thank you in advance
-Kamy
.Kamy,
This will do it at least as you specified.
SET NOCOUNT ON
GO
IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
GO
CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
GO
INSERT test VALUES ('A001',0)
INSERT test VALUES ('A001',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A002',0)
INSERT test VALUES ('A003',0)
INSERT test VALUES ('A003',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('B011',0)
INSERT test VALUES ('C189',0)
INSERT test VALUES ('D9090',0)
GO
ALTER TABLE dbo.test add Ctr int not null identity(1,1)
GO
SELECT t1.TestCol
, (SELECT COUNT(*) FROM test t2 WHERE t1.testcol = t2.testcol AND t1.Ctr
>= t2.Ctr)
FROM test t1
GO
ALTER TABLE dto.test DROP COLUMN Ctr
Hope this helps,
Ron
--
Ron Talmage
SQL Server MVP
"Kamy" <anonymous@.discussions.microsoft.com> wrote in message
news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
> I have a need to update data in a table so that
> a column contains the generated number for sets of records
> for instance I have fileName as listed and it should
> generate the SheetNum for each of the set
> FileName SheetNum
> A001 1
> A001 2
> A002 1
> A002 2
> A002 3
> A003 1
> A003 2
> B011 1
> B011 2
> B011 3
> C189 1
> D9090 1
> Thank you in advance
> -Kamy
> .
>|||Thank you Ron,
I will try it out.
-Kamy
>--Original Message--
>Kamy,
>This will do it at least as you specified.
>SET NOCOUNT ON
>GO
>IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
>GO
>CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
>GO
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('C189',0)
>INSERT test VALUES ('D9090',0)
>GO
>ALTER TABLE dbo.test add Ctr int not null identity(1,1)
>GO
>SELECT t1.TestCol
> , (SELECT COUNT(*) FROM test t2 WHERE t1.testcol =t2.testcol AND t1.Ctr
>>= t2.Ctr)
>FROM test t1
>GO
>ALTER TABLE dto.test DROP COLUMN Ctr
>Hope this helps,
>Ron
>--
>Ron Talmage
>SQL Server MVP
>"Kamy" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
>> I have a need to update data in a table so that
>> a column contains the generated number for sets of
records
>> for instance I have fileName as listed and it should
>> generate the SheetNum for each of the set
>> FileName SheetNum
>> A001 1
>> A001 2
>> A002 1
>> A002 2
>> A002 3
>> A003 1
>> A003 2
>> B011 1
>> B011 2
>> B011 3
>> C189 1
>> D9090 1
>> Thank you in advance
>> -Kamy
>> .
>>
>
>.
>|||hi Ron,
It didn't work, as soon as I add an identity column,
it inserts running nos. into the field.
Am I missing something?
Thank you,
-Kamy
>--Original Message--
>Kamy,
>This will do it at least as you specified.
>SET NOCOUNT ON
>GO
>IF OBJECT_ID('dbo.test') IS NOT NULL DROP TABLE dbo.test
>GO
>CREATE TABLE dbo.test (TestCol varchar(10), Seq int)
>GO
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A001',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A002',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('A003',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('B011',0)
>INSERT test VALUES ('C189',0)
>INSERT test VALUES ('D9090',0)
>GO
>ALTER TABLE dbo.test add Ctr int not null identity(1,1)
>GO
>SELECT t1.TestCol
> , (SELECT COUNT(*) FROM test t2 WHERE t1.testcol =t2.testcol AND t1.Ctr
>>= t2.Ctr)
>FROM test t1
>GO
>ALTER TABLE dto.test DROP COLUMN Ctr
>Hope this helps,
>Ron
>--
>Ron Talmage
>SQL Server MVP
>"Kamy" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0ccb01c49c09$2a105a50$a301280a@.phx.gbl...
>> I have a need to update data in a table so that
>> a column contains the generated number for sets of
records
>> for instance I have fileName as listed and it should
>> generate the SheetNum for each of the set
>> FileName SheetNum
>> A001 1
>> A001 2
>> A002 1
>> A002 2
>> A002 3
>> A003 1
>> A003 2
>> B011 1
>> B011 2
>> B011 3
>> C189 1
>> D9090 1
>> Thank you in advance
>> -Kamy
>> .
>>
>
>.
>
Subscribe to:
Posts (Atom)