Butterfly2
asked on
Copy records into a a table from the same table changing only one value
I have a table that has 6 fields , here is the query:
insert into [GSDR].[d2l].[d2l_reportin g_SchoolPo pulation]( '2014-08-1 1',
[Schoolcode],
[School],
[Cluster],
[StudentCount],
[IntructorCount])
Select
[Schoolcode],
[School],
[Cluster],
[StudentCount]
[IntructorCount]
from [GSDR].[d2l].[d2l_reportin g_SchoolPo pulation]
I want to put in a population date of 2014-08, but basically copy all the other values.
here is my table
PopulationDate Schoolcode School Cluster StudentCount IntructorCount
8/18/2014 978 ALCOVA ELEMENTARY SCHOOL DACULA 1133 71
8/18/2014 155 ALFORD ELEMENTARY SCHOOL BERKMAR 1021 62
This is want I want
PopulationDate Schoolcode School Cluster StudentCount IntructorCount
8/18/2014 978 ALCOVA ELEMENTARY SCHOOL DACULA 1133 71
8/18/2014 155 ALFORD ELEMENTARY SCHOOL BERKMAR 1021 62
8/11/2014 978 ALCOVA ELEMENTARY SCHOOL DACULA 1133 71
8/11/2014 155 ALFORD ELEMENTARY SCHOOL BERKMAR 1021 62
insert into [GSDR].[d2l].[d2l_reportin
[Schoolcode],
[School],
[Cluster],
[StudentCount],
[IntructorCount])
Select
[Schoolcode],
[School],
[Cluster],
[StudentCount]
[IntructorCount]
from [GSDR].[d2l].[d2l_reportin
I want to put in a population date of 2014-08, but basically copy all the other values.
here is my table
PopulationDate Schoolcode School Cluster StudentCount IntructorCount
8/18/2014 978 ALCOVA ELEMENTARY SCHOOL DACULA 1133 71
8/18/2014 155 ALFORD ELEMENTARY SCHOOL BERKMAR 1021 62
This is want I want
PopulationDate Schoolcode School Cluster StudentCount IntructorCount
8/18/2014 978 ALCOVA ELEMENTARY SCHOOL DACULA 1133 71
8/18/2014 155 ALFORD ELEMENTARY SCHOOL BERKMAR 1021 62
8/11/2014 978 ALCOVA ELEMENTARY SCHOOL DACULA 1133 71
8/11/2014 155 ALFORD ELEMENTARY SCHOOL BERKMAR 1021 62
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
disregard, i removed the parenthesis and it works, thanks.
ASKER
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ','.