<?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 Timestamps are not returned as datetime by custom ODBC data connector in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Timestamps-are-not-returned-as-datetime-by-custom-ODBC-data/m-p/756224#M20201</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a custom ODBC dataconnector which uses an ODBC driver &lt;A href="https://www.elastic.co/guide/en/elasticsearch/reference/6.7/sql-client-apps-powerbi.html" target="_self"&gt;provided by Elasticsearch&lt;/A&gt;. My connector script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[DataSource.Kind="ElasticOdbcConnector", Publish="ElasticOdbcConnector.Publish"]
shared ElasticOdbcConnector.Contents = (server as text) =&amp;gt;
    let
	ConnectionString = [
            Driver = "Elasticsearch Driver",
            Server = server,
            ApplicationIntent = "readonly"
        ],
        OdbcDatasource = Odbc.DataSource(ConnectionString)
    in
        OdbcDatasource;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I retrieve the data in Power BI Desktop using DirectQuery, the timestamp field is not listed as a datetime field:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elastic_timestamp1.PNG" style="width: 165px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/182222i7D5BACBE822DD738/image-size/large?v=v2&amp;amp;px=999" role="button" title="elastic_timestamp1.PNG" alt="elastic_timestamp1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can convert it to a datetime field via PowerQuery, but then I'll lose the DirectQuery capability of my connector.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I connect to Elasticsearch using the standard ODBC connector and a DSN, the timestamp field is listed as a datetime field correctly:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elastic_timestamp2.PNG" style="width: 162px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/182224iFB66DEB64E2830AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="elastic_timestamp2.PNG" alt="elastic_timestamp2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I let PowerBI see the correct field types? Is there something extra I need to do in my custom data connector?&lt;/P&gt;</description>
    <pubDate>Fri, 02 Aug 2019 09:39:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-02T09:39:31Z</dc:date>
    <item>
      <title>Timestamps are not returned as datetime by custom ODBC data connector</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Timestamps-are-not-returned-as-datetime-by-custom-ODBC-data/m-p/756224#M20201</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a custom ODBC dataconnector which uses an ODBC driver &lt;A href="https://www.elastic.co/guide/en/elasticsearch/reference/6.7/sql-client-apps-powerbi.html" target="_self"&gt;provided by Elasticsearch&lt;/A&gt;. My connector script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[DataSource.Kind="ElasticOdbcConnector", Publish="ElasticOdbcConnector.Publish"]
shared ElasticOdbcConnector.Contents = (server as text) =&amp;gt;
    let
	ConnectionString = [
            Driver = "Elasticsearch Driver",
            Server = server,
            ApplicationIntent = "readonly"
        ],
        OdbcDatasource = Odbc.DataSource(ConnectionString)
    in
        OdbcDatasource;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I retrieve the data in Power BI Desktop using DirectQuery, the timestamp field is not listed as a datetime field:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elastic_timestamp1.PNG" style="width: 165px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/182222i7D5BACBE822DD738/image-size/large?v=v2&amp;amp;px=999" role="button" title="elastic_timestamp1.PNG" alt="elastic_timestamp1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can convert it to a datetime field via PowerQuery, but then I'll lose the DirectQuery capability of my connector.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I connect to Elasticsearch using the standard ODBC connector and a DSN, the timestamp field is listed as a datetime field correctly:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elastic_timestamp2.PNG" style="width: 162px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/182224iFB66DEB64E2830AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="elastic_timestamp2.PNG" alt="elastic_timestamp2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I let PowerBI see the correct field types? Is there something extra I need to do in my custom data connector?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 09:39:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Timestamps-are-not-returned-as-datetime-by-custom-ODBC-data/m-p/756224#M20201</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-02T09:39:31Z</dc:date>
    </item>
  </channel>
</rss>

