AnsweredAssumed Answered

copy fields in to new table.

Question asked by bb69 on Apr 1, 2009
Latest reply on Apr 1, 2009 by philmodjunk

Title

copy fields in to new table.

Post

Hello,

 

I have a script that copies information from one table to another.  I preform a search and then copy the values I want in the first table to the second table.  Now on the first table, most of the items are the same except for a few of them.  In the script below, the set variables with either 8 or 10 are the different projects.  

What I want to do on the second table is check if the OEM number exists, then paste the missing fields from the first table.  If it does not exist, paste  to a new record.   I get 20 records when I do my search on the first table and I want it to be 10 records on the second table because every 2 records have the same OEM number.  What I am getting is the first 10 records appear like I want them to, showing both projects with the same OEM number, but I get 10 more records with just the second project.  It looks like this:

 

<!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:WordDocument&amp;gt;   &amp;lt;w:View&amp;gt;Normal&amp;lt;/w:View&amp;gt;   &amp;lt;w:Zoom&amp;gt;0&amp;lt;/w:Zoom&amp;gt;   &amp;lt;w:PunctuationKerning/&amp;gt;   &amp;lt;w:ValidateAgainstSchemas/&amp;gt;   &amp;lt;w:SaveIfXMLInvalid&amp;gt;false&amp;lt;/w:SaveIfXMLInvalid&amp;gt;   &amp;lt;w:IgnoreMixedContent&amp;gt;false&amp;lt;/w:IgnoreMixedContent&amp;gt;   &amp;lt;w:AlwaysShowPlaceholderText&amp;gt;false&amp;lt;/w:AlwaysShowPlaceholderText&amp;gt;   &amp;lt;w:Compatibility&amp;gt;    &amp;lt;w:BreakWrappedTables/&amp;gt;    &amp;lt;w:SnapToGridInCell/&amp;gt;    &amp;lt;w:WrapTextWithPunct/&amp;gt;    &amp;lt;w:UseAsianBreakRules/&amp;gt;    &amp;lt;w:DontGrowAutofit/&amp;gt;   &amp;lt;/w:Compatibility&amp;gt;   &amp;lt;w:BrowserLevel&amp;gt;MicrosoftInternetExplorer4&amp;lt;/w:BrowserLevel&amp;gt; &amp;lt;/w:WordDocument&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:LatentStyles DefLockedState=&amp;quot;false&amp;quot; LatentStyleCount=&amp;quot;156&amp;quot;&amp;gt; &amp;lt;/w:LatentStyles&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal      {mso-style-parent:&amp;quot;&amp;quot;;      margin:0cm;      margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;} @page Section1      {size:612.0pt 792.0pt;      margin:72.0pt 90.0pt 72.0pt 90.0pt;      mso-header-margin:36.0pt;      mso-footer-margin:36.0pt;      mso-paper-source:0;} div.Section1      {page:Section1;}    --><!--   [if gte mso 10]&amp;gt; &amp;lt;style&amp;gt; /* Style Definitions */ table.MsoNormalTable      {mso-style-name:&amp;quot;Table Normal&amp;quot;;      mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      mso-style-noshow:yes;      mso-style-parent:&amp;quot;&amp;quot;;      mso-padding-alt:0cm 5.4pt 0cm 5.4pt;      mso-para-margin:0cm;      mso-para-margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:10.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ansi-language:#0400;      mso-fareast-language:#0400;      mso-bidi-language:#0400;} table.MsoTableGrid      {mso-style-name:&amp;quot;Table Grid&amp;quot;;      mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      border:solid windowtext 1.0pt;      mso-border-alt:solid windowtext .5pt;      mso-padding-alt:0cm 5.4pt 0cm 5.4pt;      mso-border-insideh:.5pt solid windowtext;      mso-border-insidev:.5pt solid windowtext;      mso-para-margin:0cm;      mso-para-margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:10.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ansi-language:#0400;      mso-fareast-language:#0400;      mso-bidi-language:#0400;} &amp;lt;/style&amp;gt; &amp;lt;![endif]   -->

Oem number    Project 1   Project 2   Price / unit project 1   Price / unit project 2

1234              One          Two           $1                           $2

1234                             Two                                         $2

 

 I would like to just have the first OEM number and not both.

the script is in the reply, can anyone help me with it?

 

<!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:WordDocument&amp;gt;   &amp;lt;w:View&amp;gt;Normal&amp;lt;/w:View&amp;gt;   &amp;lt;w:Zoom&amp;gt;0&amp;lt;/w:Zoom&amp;gt;   &amp;lt;w:PunctuationKerning/&amp;gt;   &amp;lt;w:ValidateAgainstSchemas/&amp;gt;   &amp;lt;w:SaveIfXMLInvalid&amp;gt;false&amp;lt;/w:SaveIfXMLInvalid&amp;gt;   &amp;lt;w:IgnoreMixedContent&amp;gt;false&amp;lt;/w:IgnoreMixedContent&amp;gt;   &amp;lt;w:AlwaysShowPlaceholderText&amp;gt;false&amp;lt;/w:AlwaysShowPlaceholderText&amp;gt;   &amp;lt;w:Compatibility&amp;gt;    &amp;lt;w:BreakWrappedTables/&amp;gt;    &amp;lt;w:SnapToGridInCell/&amp;gt;    &amp;lt;w:WrapTextWithPunct/&amp;gt;    &amp;lt;w:UseAsianBreakRules/&amp;gt;    &amp;lt;w:DontGrowAutofit/&amp;gt;   &amp;lt;/w:Compatibility&amp;gt;   &amp;lt;w:BrowserLevel&amp;gt;MicrosoftInternetExplorer4&amp;lt;/w:BrowserLevel&amp;gt; &amp;lt;/w:WordDocument&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:LatentStyles DefLockedState=&amp;quot;false&amp;quot; LatentStyleCount=&amp;quot;156&amp;quot;&amp;gt; &amp;lt;/w:LatentStyles&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if !mso]&amp;gt;&amp;lt;div classid=&amp;quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&amp;quot; id=ieooui&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;style&amp;gt; st1\:*{behavior:url(#ieooui) } &amp;lt;/style&amp;gt; &amp;lt;![endif]   --><!--   /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal      {mso-style-parent:&amp;quot;&amp;quot;;      margin:0cm;      margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;} @page Section1      {size:612.0pt 792.0pt;      margin:72.0pt 90.0pt 72.0pt 90.0pt;      mso-header-margin:36.0pt;      mso-footer-margin:36.0pt;      mso-paper-source:0;} div.Section1      {page:Section1;}    --><!--   [if gte mso 10]&amp;gt; &amp;lt;style&amp;gt; /* Style Definitions */ table.MsoNormalTable      {mso-style-name:&amp;quot;Table Normal&amp;quot;;      mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      mso-style-noshow:yes;      mso-style-parent:&amp;quot;&amp;quot;;      mso-padding-alt:0cm 5.4pt 0cm 5.4pt;      mso-para-margin:0cm;      mso-para-margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:10.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ansi-language:#0400;      mso-fareast-language:#0400;      mso-bidi-language:#0400;} &amp;lt;/style&amp;gt; &amp;lt;![endif]   -->

Brian

Outcomes