June 9, 2016 at 1:53 pm
SELECT TOP 1000 [SubjectID]
,[Phase_ID]
FROM [dbo].[TEST]
SubjectIDPhase_ID
1 2
2 3
2 2
3 3
4 3
5 2
6 2
7 3
7 2
I would like to add one more column that shows if Subject Change their phase from 3 to 2 , I need to display yes.
Can you help me ?
Thanks
June 9, 2016 at 2:22 pm
There's no way to know if it changed from 3 to 2 or from 2 to 3. There's no way to define the order in that table.
June 9, 2016 at 2:30 pm
I need to change always 3 to 2.
June 9, 2016 at 2:36 pm
patla4u (6/9/2016)
SELECT TOP 1000 [SubjectID],[Phase_ID]
FROM [dbo].[TEST]
SubjectIDPhase_ID
1 2
2 3
2 2
3 3
4 3
5 2
6 2
7 3
7 2
I would like to add one more column that shows if Subject Change their phase from 3 to 2 , I need to display yes.
Can you help me ?
Thanks
Update trigger on the source table to write change history would do the trick.
June 9, 2016 at 2:51 pm
I didn't get it.
June 13, 2016 at 9:12 pm
Manic Star (6/9/2016)
patla4u (6/9/2016)
SELECT TOP 1000 [SubjectID],[Phase_ID]
FROM [dbo].[TEST]
SubjectIDPhase_ID
1 2
2 3
2 2
3 3
4 3
5 2
6 2
7 3
7 2
I would like to add one more column that shows if Subject Change their phase from 3 to 2 , I need to display yes.
Can you help me ?
Thanks
Update trigger on the source table to write change history would do the trick.
But not for existing rows.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 13, 2016 at 10:59 pm
patla4u (6/9/2016)
I didn't get it.
which change is presented by these 2 rows:
23
22
3 --> 2 or 2 --> 3?
_____________
Code for TallyGenerator
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply