Replicate process from excel to sql

  • Hi All,
    I have a script that outputs data to a txt file which is then manipulated in excel to get yet another output. eg.
    The first table is the txt file output. Based on the 'Status' column I want to change the Name, as in the second table
    Where Status = 'Out' .... change Name to 'Out'

    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOwAAAEjCAYAAAAxGu3BAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAACeZSURBVHhe7Z1NaCNZtuf/+WY3s3MLb+pRTVdbTltgmGEoCgmPqYLe2CTGY2hTDxovvJChemPRJCTdGB4YGkNSyJtXPGvAC/MWDxfkGGPsRTdUkQiJXBtsp6SuRb2ujUetTS/eMuee+yFdheJT36E4vyRIhSIcETd0T5xzb9xz/88+/fTTD2AYJhY8+9WvfjVyg11cXNSfkketVuPyc/n12uA8++qrr0ZqsPyDcfm5/MMr/z/o/xmGiQGz7WEz23i1mULlrIS3T/q7MTP28s+vIb+Xw5xe7dCayH2Y2O/vvA+1Kxy/udcr42PY5f8vn3766T/rzyPhb3/7G372s5/ptXEyj7X//Sv853/8B/77x89Qfvh/+vvxMvby/7ef43/+j//En47/D/5vuYyyWVo/xz99uYxW+QHjvBMT+f3pQf3lf7XuQQ3/8L++xD/9vDX2ejDs8g81JP773/+uP00B80tYmqvhsdxEa3EJGf11Yrl/RA0ppOb1+sySwfbmonCob9Dxp094e1kR9WAVazEv/9AMloy12Wzqtckzv7SEudoj7p/eolxbxGrcf6lBySxhsVaeWNNgbFA5xaPp0Rn9inpQOp5c02hYDMVgp81Y6Sm7mgMqZfWr3T/WMCcMODkmu4jNV6/wyl6E12lN1W80QlpNzGpJBzbY6TNWAT1lW494NE9TCgfnclhNTFxcw9XxMY7t5awC5LZiHxImnYEMdiqNlTqbVhcBYaB7bQ+zKXyO8DtLCW7JPpHXmUMqpddnmTnRVtcfZ42+DXY6jVWgO5vcPMwsdDoMRkv8ZvrjrCI71xbR+2zOYFs8vLdj/szuy2Cn1lgFGdF4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B+ymty3N2tvWKSGfRjtBvL1HKahlLgTyO+uh/jrHBCuxRiW6wT29ROi6he8KJhCqwyzDWKajso8BOlbL6IPxyh/VTY+w3lqwk4aG03uOl01juEoPuqJo33tPjxIb21R8lk1ZzZwX2qEQ3WKZ/tCDzUai2mofSeo/RU1hueVWLhecr+pNBhfAdWM09bkQ3WFZg7xBVgZ0Emc+pN9j5Cke1J9sezk9p3aHQLsNeL09F4XK1gNd638bJUbhzMFNLdINlBfYOkRXYBTKMrmPnIq1DUVrSKKzQu1zj4fyU1tUroDuzbeMORU8V9u590w8rwqcab8xq7nGEB/+PGDIGCjenA3qNc4Tl+vhC3+kq//gZdvm5DTvLyDDXetXkFz4zsYANdpYR4bdqMocJn5k4wAnsDDNiOIE9RtT/8gPSv/xEryUPLv9wy88hMcPECDZYhokRwQbrqrI+j7W8Gfz/Cvnkjv5nmLESYLDuCeyZ7T3kUJHpdyTXgdxWgjN2GGZ8eBqsdwI7CWK1ULnUo5ue3JIBGIYZBd4e1iuBXabXNdFkA2WYseNpsJ4J7DSfU0sYsfTAqg2bPKlJhpkMwZ1ObszlsIpLlcB+VcPiZpJnnWCY8dGfwbYquDSN1vsyKq05crwMw4yY6AbbbKI1p6aJYRhmvEQ32Ke3KNcWsWpi4MwqcnM1PCZOgZ1hxk9fIfH9mzM8Lu2pTqfNRdSu3jgk7RmGGQU8+H/E8OB3Lj8P/meYhMIGyzAxYiwJ7N/866n+xDDMIHAbdsRwG47LP7zyA/8f6jJE9kpiLbIAAAAASUVORK5CYII=

    The following vb code loops through all the rows and makes the changes:

    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATEAAACTCAYAAADmxi45AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAA+kSURBVHhe7d2/a+NoHsfxb+6vuPI44oEdXG5x2MXCdckORyoXB8d0dnEHcTNd2GJJN40N28TdsDCFq2HZk+GKhS1irrjSzEKcYsvdv8L3fKVH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kiQHwGt/YB+A1zokB8BqVGACvUYkB8BqVGACvUYkB8BqVGACvUYkB8BqVGACvUYkhEafGdpOIIaD5GtOIcctRTWaDvRohDX68lED0Jk7AJ1Rijkx+fXcs425XyrQHGzP6TVelQdl3/HXQ4Me1OGzAA1RiljYgYSWyilJTl72pDEtm6YQNgH1fvrtPkxK3OmT8wEtGJRaaySf9AQ6nEokapnsnrXWzwyuxw8afyfe/nNiY7egxv4aEU0clVoM6KrGD6I+axOMM+plfbeIIEaeOSix0IVftYa5qin478nkqmWOPH/AXlZilvybUm6aHYfqrRxI8XyVz7PEnFxXcw1F+Eg4eaMyXXbUS42sWAKriG/sAvMY5MQBeoxID4DUqMQBeCyux33+3jwDAM42pxABgHzRiALxGIwbAazRiALzWjEbsp4H88Y9nTjeQn2wvANimUVcnf3rXlcd/3kv/T/YJANjBq8PJyZvt1dqm/tHzXZlM3IrPPP7VvgCAt7xpxLQh+uFvS/ntt1XUfRT5+5s0ZWFb//6PK/n2y7l8843Ix7j/f3vyw184bAV850cj9utYfvgikB/7TsDgX+/k4xfTqJra1d/6x8c7+av9W/50Ld99u5AZrRjgtUY3Yr9OuvKutkamI60/2z8BnAw/KjFTNf3tl9vcOayZzH7pRRcBdvUPmcPJf2VD/v7zQ1suktIMgI+acXVSv2Lx94l9kPWPjyt5rw2NOWR885eh/C96OpT0Uzv6T950ZfmFyPffpz8h9OW3y+whKADvvJgbwLURk+/4+gZwal5EI6ZXLr+JS7QvR/Lbj9f2AQDfEcUDwGtefdkVAPJoxAB4LTyctH8DgHeoxAB4jUYMgNdoxAB4jUYMgMdE/g9UyEPF0ZM8UgAAAABJRU5ErkJggg==

    So my quandary is, I want to eliminate the above code and perform the change in a tsql query, to get rid of the excel report and use SSRS. I don't want to make a permanent change to the data as it is just for reporting purposes.

    Any help would be appreciated

  • what you want is a case statement to pick one column or the other base don the value.
    here's a complete working example based on what you posted. see how the Case statement selects one column or the other...it could pick a static value, or a column in your example.
    IF OBJECT_ID('tempdb.[dbo].[#MySampleTable]') IS NOT NULL
    DROP TABLE [dbo].[#MySampleTable]
    CREATE TABLE #MySampleTable (
    ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
    [Name] VARCHAR(30),
    [Status] VARCHAR(5) )
    INSERT INTO #MySampleTable([Name],[Status])
    SELECT 'John','In' UNION ALL SELECT 'Pete','Out' UNION ALL
    SELECT 'Sue','In' UNION ALL SELECT 'Mary','Out' UNION ALL
    SELECT 'George','In'

    SELECT
      ID,
      CASE
        WHEN [Status] = 'Out'
        THEN [Status]
        ELSE [Name]
      END AS [Name],
    [Status]
    FROM #MySampleTable

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks Lowell
    that works a treat however I need to replicate that across all the columns, to hide all the details in the record. Do I just add the same code to each field in the query. For instance if I had several columns, I take it this would be the same:

    SELECT
      ID,
      CASE
        WHEN [Status] = 'Out'
        THEN [Status]
        ELSE [Name]
      END AS [Name],
        CASE
        WHEN [Status] = 'Out'
        THEN [Status]
        ELSE [Tel]
      END AS [Tel],
        CASE
        WHEN [Status] = 'Out'
        THEN [Status]
        ELSE [Workstation]
      END AS [Workstation],
        CASE
        WHEN [Status] = 'Out'
        THEN [Status]
        ELSE [Building]
      END AS [Building],
    [Status]
    FROM #MySampleTable

    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXMAAAEvCAYAAAC39iEeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAADxBSURBVHhe7Z1LbxtJlu+P7tfwTF10DTmG3NC6QKEWZWA2JLTQoku3Fr5apgC7gRFRMGBMQysBDQNGgVq0jSsudWvRkHuhhUAuqoGqRY8Ir3XbhpuaGkxN+3PwnhOPzMhkPskkxcz8/4CsEjPyEc8TJyLS8d96+vTp7G9/+xv98z//M4Ewdc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g3TLAZtVId0ldMCtI5vdKUfRecFuZduWyNvDJYJsQ0mTJu2OxP6kFSrWw/ZlAfGXuYiaeeh3yhS37dquueBAd0+5XeLAeXRx6GsK7hTTxEWvc8hrbyKliWwBE4DW1s6UDNgOUxUdz/IbxnBdg5oL6igPiEHqN2PaQtgGWDMLcoD7tB23PSw4FbYVNjzNoYqOEwv3t7mN0SZ0odJyntVvAKD3RuGPfvU960R5WmpTkfS4055tKnPvyf9duzXCovel1peWWUJ5lF1MzxCzE+Xnsu0CTcOcTbcaTMfHo21ZdRl66h4/iYIlENjjfn4KDyvOuax4STBo9CYCsvGJnHoqbyZIZ0mTdiacPfrjbuz00RPRiHevMyR+4ba8Vyz3rdKZDHLTYfMkyrPTi+aBvGdqi9hOoOp/lphwfumKeVVvCzBHKouOXPf41fcmXboIGcmqk552FPOxkkOT0KVkfkblENjjXl3fyc0PdG7HdDUmdOLQ02tsEdx63uPfPTYExk8NwZW5m6ndHDJ3qQNl8P3LCV8RB5XehumPgVLe2/3nEYUXD//vLT3LYtdsXe8ZP6tvv2Wxn/rpEPmSac5pkgWvC+tvBYpSxCF69KFWmzQ+ai+3CowwlOdAf9/buHTIPVYPkM1ZXS6PeAxJSgTbIGbglQ68RLvE//bX8c4yWdcp9vTYOEwJ5uQnvuiyWkvi6bkYRXTKXHGnPmGM5WJ5NCC5x19lG/IAADAAcZ8w+meT+ns/7nTLG16+7+Ke+UAgHoDY77xtOhf/91dGJzRv/8rDDkAIAw0QAEAoPIQ/X81NOsbiEiWWQAAAABJRU5ErkJggg==

  • Yes, you'll end up needing  bunch of case statements, one for each column.
    This could also be done int he presentation layer, so for example SSRS could use an expression with the same logic, but the syntax looks different.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • On the same issue I am adding more columns but, I have a field which is a DateTime and will not let me substitute the field with 'Out'.

    CASE
        WHEN [Status] = 'Out'
     then [Status] 
        ELSE [MyTable.DateField]
      END AS [MyTable.DateField]

    I am getting errors converting the field!

  • CONVERT the date field to varchar() for display purposes as part of the query.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • Hi sgmunson,
    the Case statement will not accept the code, I get
    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT4AAAAhCAYAAABAz8fKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAsWSURBVHhe7VxrbFTHFf7WVQvmUSCVEP9CvSgBFZN6aSVwaJQ+wEDC0w8qoYJRooAXbBSq1A9ASjEYDITaZuNULa2NK6TYFnXMa9dp1UjUKH9qg+0WCN7mB1LShqZQgoULAm7P3Dt379y7c6+XZg32Mt/ywcyZc87MnDl37swa8GnhsIZ584DTp4Fz54CsLODCBWDZMiRVrmnAlCkYHTiDV32/x2rtCJZyiYKCQurAp92/ryEtDbhzB/j4Y+CTTwC/H3j6aSRV/uCB8aeCgoLCY4bv2LFj2pUrVzA4OMhFCgoKCqMf6enpmD59OnJzczFx4kQuNeDr7OzUsrOz4fP5uEhBQUFh9EPTNFy8eBFnz55FUVERlxrw3aerrtr0FBQUUhVlZWWorq7mNQNptPfpP3dQVFRUTEXK4Lt3775Lk4KCgsLoR0VFedyJz3f37j218SkoKKQsduyoiL/qyo6GioqKiqlCGdI0qI/6qI/6pO5HBpcTXxS12V/F2DHE7Br0S3UURzbD2DTk2pHOmHmo7Ze1eTER3yJZPzyfODeFZXrDzP4aZP9f8x2a4U00L5qUXc7nLZWb44iPTXZN1KHvwfBGD9tHF3d9/o6+GI3xiPMV6R0HY6xc7hlDb8pAGx/tiXH0o7jzBAoxF/sat8Iv1RlJDKNoLAuCrC1ZfBR9JJO0uvrCy9pMGkkgb/NiIr5Fsl4ol/ru4vagwfocmV6y6Vgz/1Z0Dn6IYr+okwTShlrZswGFPT935Icx70DP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mO3GdKqq7dqHvnxDNjnQjNyueloQp72sbthC8Dm5mH0n597Xy+torAFTz/RD7CiK6c6toGNykB/TM4pRntmIpsydCNKOYuh7jcvRB715dqMUc5nvVy5hdhbT69fj1rdnG80zByV7elHwIouf6c/p01l3mbe0L5kvN7rFU7CXxsnNTvSdyBiYDo8d9/P9UMQlVkw3gNmX1xu6gVLMbjHz5svmhThWseysUz8ttKnw3H1VK8BPJHN8/2QjsvKW8GuuST9y8gJoOunsj5Py7td7AiQ15UxHjE0lnum6jVraufR2ti5xOcS5sB432A9W+JwnT1oFreU2/mTmeFz/LM4wnmlXv0aME3tuZZTpuNmJclZ25gj7WkViK42hQ0egDL7rN27LW54A/KFkHE4tY0nGBQojAB3YOqUSz/6lE/T8jgz8vQ4//M5llN2gDYCLHhWGK0efpNzft/dN2b/Vle+SKU86wu/96z6U/EjSpvh4SYkplT8mvl9bhvNZMx0nu0fBCE7+rhAvJT1Hh8vvyKQM3n+BOSUZRf0PxuMb321B7q+K9e/N5HqKj40mZG2PhDxHnjL4Y9ok3v3j48gVunb++226ZsravgyHy+8IpQS+zz8fcGlSUFBQGP3Yv3+X5KpLvykqKiqmKmXwXfvXLbc2BQUFhVGPgwcq4/8H5n9+9oXa+BQUFFIWh97arf4HZkVFxSeLMvg+/cdNlyYFBQWF0Y+aX+yJP/Gx32S7pKKiouJopxu+kl+Q/+akSU+RkoeWgoKCwiiDj3j9+jVc++xTzJ8/3xBy+EKhkHb16lVeVVBQUEgdTJs2DWvXrsXUqVO5xICPTnrqqKegoPBEQf+OT0FBQeHJAfA/p6LnMiHupG4AAAAASUVORK5CYII=
    unless I'm doing it wrong
    CASE
    WHEN [Status] = 'Out'
    then convert(varchar(10),MyTable.DateField,101) [Status]
        ELSE [MyTable.DateField]
    END AS [MyTable.DateField]

  • sgmunson - Monday, July 10, 2017 7:47 AM

    CONVERT the date field to varchar() for display purposes as part of the query.

    At this point, I'm not sure that's the right idea. This could cause problems on your front end as the data type is no longer a date type.  Take for example:
    CREATE TABLE #Dates (DateValue date, Status varchar(3));
    GO
    INSERT INTO #Dates
    VALUES ('20170201','In'),('20170205','In'),('20170110','Out'),('20170315','In'),('20170122','In');
    GO
    SELECT DateValue, Status
    FROM #Dates
    ORDER BY DateValue;
    GO
    SELECT CASE Status WHEN 'Out' THEN 'Out' ELSE CONVERT(varchar(10), DateValue, 103) END AS NewDateValue
    FROM #Dates
    ORDER BY NewDateValue;
    GO
    DROP TABLE #Dates
    GO

    In the Second statement the order of the dates is:
    01/02/2017
    05/02/2017
    15/03/2017
    22/01/2017
    Out --this was the Date 10/01/2017

    Yes, you could order by DateValue in the ORDER BY, but if you're not ordering in the SP and instead in your front end, then you're going to be ordering on NewDateValue, not the one in the query. Personally I would go what Lowell suggests, and use your presentation layer to change the value based on the status field.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Radders - Monday, July 10, 2017 7:57 AM

    Hi sgmunson,
    the Case statement will not accept the code, I get
    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT4AAAAhCAYAAABAz8fKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAsWSURBVHhe7VxrbFTHFf7WVQvmUSCVEP9CvSgBFZN6aSVwaJQ+wEDC0w8qoYJRooAXbBSq1A9ASjEYDITaZuNULa2NK6TYFnXMa9dp1UjUKH9qg+0WCN7mB1LShqZQgoULAm7P3Dt379y7c6+XZg32Mt/ywcyZc87MnDl37swa8GnhsIZ584DTp4Fz54CsLODCBWDZMiRVrmnAlCkYHTiDV32/x2rtCJZyiYKCQurAp92/ryEtDbhzB/j4Y+CTTwC/H3j6aSRV/uCB8aeCgoLCY4bv2LFj2pUrVzA4OMhFCgoKCqMf6enpmD59OnJzczFx4kQuNeDr7OzUsrOz4fP5uEhBQUFh9EPTNFy8eBFnz55FUVERlxrw3aerrtr0FBQUUhVlZWWorq7mNQNptPfpP3dQVFRUTEXK4L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Jopxu+kl+Q/+akSU+RkoeWgoKCwiiDj3j9+jVc++xTzJ8/3xBy+EKhkHb16lVeVVBQUEgdTJs2DWvXrsXUqVO5xICPTnrqqKegoPBEQf+OT0FBQeHJAfA/p6LnMiHupG4AAAAASUVORK5CYII=
    unless I'm doing it wrong
    CASE
    WHEN [Status] = 'Out'
    then convert(varchar(10),MyTable.DateField,101) [Status]
        ELSE [MyTable.DateField]
    END AS [MyTable.DateField]

    remove the word "[Status]" (the bold one) and that should fix the syntax error.

    But as Thom points out, this may break whatever application is trying to read the data.  If it is expecting a datetime and it gets a varchar(10), it may have undesired effects.
    Depending on the presentation layer (C#, SSRS, etc), you may have better results changing it at that end as both Thom and Lowell point out.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Radders - Monday, July 10, 2017 7:57 AM

    Hi sgmunson,
    the Case statement will not accept the code, I get
    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT4AAAAhCAYAAABAz8fKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAsWSURBVHhe7VxrbFTHFf7WVQvmUSCVEP9CvSgBFZN6aSVwaJQ+wEDC0w8qoYJRooAXbBSq1A9ASjEYDITaZuNULa2NK6TYFnXMa9dp1UjUKH9qg+0WCN7mB1LShqZQgoULAm7P3Dt379y7c6+XZg32Mt/ywcyZc87MnDl37swa8GnhsIZ584DTp4Fz54CsLODCBWDZMiRVrmnAlCkYHTiDV32/x2rtCJZyiYKCQurAp92/ryEtDbhzB/j4Y+CTTwC/H3j6aSRV/uCB8aeCgoLCY4bv2LFj2pUrVzA4OMhFCgoKCqMf6enpmD59OnJzczFx4kQuNeDr7OzUsrOz4fP5uEhBQUFh9EPTNFy8eBFnz55FUVERlxrw3aerrtr0F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g+/cdNlyYFBQWF0Y+aX+yJP/Gx32S7pKKiouJopxu+kl+Q/+akSU+RkoeWgoKCwiiDj3j9+jVc++xTzJ8/3xBy+EKhkHb16lVeVVBQUEgdTJs2DWvXrsXUqVO5xICPTnrqqKegoPBEQf+OT0FBQeHJAfA/p6LnMiHupG4AAAAASUVORK5CYII=
    unless I'm doing it wrong
    CASE
    WHEN [Status] = 'Out'
    then convert(varchar(10),MyTable.DateField,101) [Status]
        ELSE [MyTable.DateField]
    END AS [MyTable.DateField]

    Try it this way:
    CASE
        WHEN [Status] = 'Out' THEN [Status]
      ELSE CONVERT(varchar(10), MyTable.DateField, 101)
    END AS DateField

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • Hi all,
    Thanks for the responses.
    Tom, SSCertifiable .. The query is being used in a SS Report so no issue about the DateTime breaking the app.
    Steve(sgmunson) that worked a treat, thank you.

    I can now get rid of that damn excel spreadsheet 🙂🙂🙂🙂

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply