<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: Database query returns DateTime when it's only Date in SQL database in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71860#M24465</link>
    <description>&lt;P&gt;Hi Babjee&lt;BR /&gt;i am not sure of your requirement but check if makes any use for you&lt;BR /&gt;try setting try connection string "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="&amp;amp;[Path]&amp;amp;";Extended Properties=""Excel 12.0 Xml;HDR=NO;IMEX=1"";" Here&amp;nbsp; HDR=NO will not give you headers but you can use utility - collection vbo to make first row as headers but the result will be in text format only&lt;BR /&gt;&lt;BR /&gt;If you require to filter data while you want to get collection and you are sure of the position of column then try this&amp;nbsp;&lt;BR /&gt;in query like "Select * From [Orders$] Where F5 = "Second Class"" here F5 is column index as 5th position based on that you can modify&lt;BR /&gt;&lt;BR /&gt;if you are not sure of column index then try to fetch columns first then get index value of that particular column later you repeat the above step&lt;BR /&gt;&lt;BR /&gt;Hope this helps you&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Lakshmi Narayana&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Thu, 13 Apr 2023 14:35:00 GMT</pubDate>
    <dc:creator>plnarayana777</dc:creator>
    <dc:date>2023-04-13T14:35:00Z</dc:date>
    <item>
      <title>Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71851#M24456</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm running a code stage to extract data from a sql table to a collection.&amp;nbsp;&lt;BR /&gt;The colum in sql is defined as Date type. But when the the result is stored in a collection the date has become DateTime. And also since we are not in UTC time zone we get -2 hours.&amp;nbsp;&lt;BR /&gt;So for example,&amp;nbsp; 2023-05-17 becomes 16.05.2023 22:00:00.&amp;nbsp;&lt;/P&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31339.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/31466i6FF7EE406D16F5D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="31339.png" alt="31339.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31340.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/31467i08C09F0BB19D3478/image-size/large?v=v2&amp;amp;px=999" role="button" title="31340.png" alt="31340.png" /&gt;&lt;/span&gt; Is there any way to just extract the date so that I don't need to convert it afterwars? I only need the date, not date and time..&amp;nbsp;&lt;BR /&gt;We are using version 6.10.5&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Rolf Syvertsen&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Apr 2023 14:10:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71851#M24456</guid>
      <dc:creator>c202c0y</dc:creator>
      <dc:date>2023-04-11T14:10:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71852#M24457</link>
      <description>&lt;P&gt;Please refer to this thread&lt;BR /&gt;&lt;A href="https://community.blueprism.com/discussion/oledb-issue?ReturnUrl=%2fcontent%2fallrecentposts" target="_blank" rel="noopener"&gt;OLEDB Issue | Blue Prism Product&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Lakshmi Narayana&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Apr 2023 07:09:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71852#M24457</guid>
      <dc:creator>plnarayana777</dc:creator>
      <dc:date>2023-04-12T07:09:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71853#M24458</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/5842"&gt;@c202c0y&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You will need to change you sql query to compensate for the difference e.g. Select TO_CHAR(fROM_TZ( CAST(ForfallsDato AS TIMESTAMP ), 'UTC' ) AT LOCAL, 'YYYY-MM-DD') AS ForfallsDato FROM YourDatabase&lt;BR /&gt;&lt;BR /&gt;Substitute UTC for the timezone you are in. This will return the value as correct date&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michael ONeil&lt;BR /&gt;Technical Lead developer&lt;BR /&gt;NTTData&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Apr 2023 15:00:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71853#M24458</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2023-04-12T15:00:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71854#M24459</link>
      <description>&lt;P&gt;Hi&amp;nbsp;MichaelONeil,&lt;BR /&gt;&lt;BR /&gt;I've&amp;nbsp; a column in my excel which has number type as majority data hence, if I read the Data through OLEDB I'm getting the rows that has numbers as is, but the rows that has non numeric data rows are being read as null attaching the screenshot. Any idea on how to cast that column to text .&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31307.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/31436i0CE15DA446C49371/image-size/large?v=v2&amp;amp;px=999" role="button" title="31307.png" alt="31307.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Babjee Vangipurapu &lt;BR /&gt;Senior RPA Developer&lt;BR /&gt;Wonderbotz&lt;BR /&gt;India&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 11:07:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71854#M24459</guid>
      <dc:creator>Babjee24</dc:creator>
      <dc:date>2023-04-13T11:07:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71855#M24460</link>
      <description>&lt;P&gt;Hi B,&lt;BR /&gt;&lt;BR /&gt;Can you share the SQL you use?&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Happy coding!&lt;BR /&gt;---------------&lt;BR /&gt;Paul&lt;BR /&gt;Sweden&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Apr 2023 11:19:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71855#M24460</guid>
      <dc:creator>PvD_SE</dc:creator>
      <dc:date>2023-04-13T11:19:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71856#M24461</link>
      <description>&lt;P&gt;Hi Paul,&lt;BR /&gt;&lt;BR /&gt;It's a basic SQL select statement select * from [Sheet1$]; If there is a way to cast I'll select individual columns from my Excel&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Babjee Vangipurapu &lt;BR /&gt;Senior RPA Developer&lt;BR /&gt;Wonderbotz&lt;BR /&gt;India&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Apr 2023 11:51:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71856#M24461</guid>
      <dc:creator>Babjee24</dc:creator>
      <dc:date>2023-04-13T11:51:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71857#M24462</link>
      <description>&lt;P&gt;Hi B,&lt;BR /&gt;&lt;BR /&gt;In Michaels response a bit earlier in this thread, he explains how to cast a date so it will be a date in your collection. Your '&lt;CODE&gt;select&amp;nbsp;* from...&lt;/CODE&gt;' does not do that, hence you get a wrong format. &lt;BR /&gt;&lt;BR /&gt;Your SQL must name all fields you want to select rather than using a '&lt;CODE&gt;select *'&lt;/CODE&gt;. Any date fields in the XL must be casted to be date formated in your collection. See Michaels answer for details.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Happy coding!&lt;BR /&gt;---------------&lt;BR /&gt;Paul&lt;BR /&gt;Sweden&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Apr 2023 12:27:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71857#M24462</guid>
      <dc:creator>PvD_SE</dc:creator>
      <dc:date>2023-04-13T12:27:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71858#M24463</link>
      <description>&lt;P&gt;Hi &lt;A class="user-content-mention" data-sign="@" data-contactkey="f71abde0-4324-41bd-bb7d-018641d3f76c" data-tag-text="@Babjee Vangipurapu" href="https://community.blueprism.com/network/profile?UserKey=f71abde0-4324-41bd-bb7d-018641d3f76c" data-itemmentionkey="918e0a43-9b30-4dcd-ac47-721b70cde8d6"&gt;@Babjee Vangipurapu&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You could try doing a cast in your statement, if the columns are showing as numbers but there are text items in there not being returned in the collection then try something like this SELECT CAST(GL reference AS CHAR(10)). You will likely need to define all the columns in your query when you run it to make sure you get all the data you need.&lt;BR /&gt;&lt;BR /&gt;There are more examples of casting here &lt;A href="https://www.databasestar.com/sql-cast/" target="_blank" rel="noopener"&gt;SQL CAST Function Explained with Examples (databasestar.com)&lt;/A&gt; which might be useful.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michael ONeil&lt;BR /&gt;Technical Lead developer&lt;BR /&gt;NTTData&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Apr 2023 12:47:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71858#M24463</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2023-04-13T12:47:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71859#M24464</link>
      <description>&lt;P&gt;Hi &lt;A class="user-content-mention" data-sign="@" data-contactkey="ddd4d6a3-af39-4c64-8db4-cdb1d05ed669" data-tag-text="@Michael ONeil" href="https://community.blueprism.com/network/profile?UserKey=ddd4d6a3-af39-4c64-8db4-cdb1d05ed669" data-itemmentionkey="be8ebc2e-f32e-4b87-acd4-dcc505c89412"&gt;@Michael ONeil&lt;/A&gt; ,&lt;BR /&gt;&lt;BR /&gt;Attaching the screenshot of the SQL query with individual column names in SQL query I'm still getting an error. I've tried without Square Brackets, without aliasing name, Aliasing name without Square brackets as well&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31323.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/31453i86ECB2C8384676AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="31323.png" alt="31323.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Attaching the error screenshot&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31324.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/31450i1CA27DF0478A5A86/image-size/large?v=v2&amp;amp;px=999" role="button" title="31324.png" alt="31324.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Babjee Vangipurapu &lt;BR /&gt;Senior RPA Developer&lt;BR /&gt;Wonderbotz&lt;BR /&gt;India&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 13:44:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71859#M24464</guid>
      <dc:creator>Babjee24</dc:creator>
      <dc:date>2023-04-13T13:44:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71860#M24465</link>
      <description>&lt;P&gt;Hi Babjee&lt;BR /&gt;i am not sure of your requirement but check if makes any use for you&lt;BR /&gt;try setting try connection string "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="&amp;amp;[Path]&amp;amp;";Extended Properties=""Excel 12.0 Xml;HDR=NO;IMEX=1"";" Here&amp;nbsp; HDR=NO will not give you headers but you can use utility - collection vbo to make first row as headers but the result will be in text format only&lt;BR /&gt;&lt;BR /&gt;If you require to filter data while you want to get collection and you are sure of the position of column then try this&amp;nbsp;&lt;BR /&gt;in query like "Select * From [Orders$] Where F5 = "Second Class"" here F5 is column index as 5th position based on that you can modify&lt;BR /&gt;&lt;BR /&gt;if you are not sure of column index then try to fetch columns first then get index value of that particular column later you repeat the above step&lt;BR /&gt;&lt;BR /&gt;Hope this helps you&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Lakshmi Narayana&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:35:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71860#M24465</guid>
      <dc:creator>plnarayana777</dc:creator>
      <dc:date>2023-04-13T14:35:00Z</dc:date>
    </item>
    <item>
      <title>RE: Database query returns DateTime when it's only Date in SQL database</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71861#M24466</link>
      <description>&lt;P&gt;Hi babjee&lt;BR /&gt;&lt;BR /&gt;The column names are these veing referenced using data items? If not then you dont need to enclose them in brackets. You only need to enclose the sheet name in brackets so your query should look like this SELECT Action Date, CAST(GL reference As varchar(40)) FROM [Sheet1$]&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michael ONeil&lt;BR /&gt;Technical Lead developer&lt;BR /&gt;NTTData&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:08:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Database-query-returns-DateTime-when-it-s-only-Date-in-SQL/m-p/71861#M24466</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2023-04-13T17:08:00Z</dc:date>
    </item>
  </channel>
</rss>

