<?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 FGDB database view — Casting date as text in SELECT clause results in blank field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/fgdb-database-view-casting-date-as-text-in-select/m-p/1372651#M77688</link>
    <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 3.2.1; file geodatabase&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I can create this FGDB database view without errors:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1705730720694.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92309iE11505079957FBEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1705730720694.png" alt="Bud_0-1705730720694.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;select 
  s.*,
  cast(t_date as char(50)) as test_col
from 
  species_records s&lt;/PRE&gt;&lt;P&gt;However, the field that uses CAST is blank in the attribute table. That's not expected.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't have that problem if I remove &lt;STRONG&gt;s.*&lt;/STRONG&gt;&amp;nbsp;and replace it with the fields listed &lt;STRONG&gt;one by one&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_2-1705731086512.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92311i5679529835365882/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_2-1705731086512.png" alt="Bud_2-1705731086512.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;select 
  objectid,
  t_unique_id,
  t_species,
  t_common_name,
  t_taxon_group,
  t_threat,
  t_grid_refer,
  t_site,
  t_date,
  cast(t_date as char(50)) as test_col
from 
  species_records s&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I don't have the &lt;STRONG&gt;s.*&lt;/STRONG&gt;&amp;nbsp;problem in a mobile geodatabase view (although the date is displayed as a number, not a textual date, but maybe that's expected for SQLite date fields):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_3-1705731305509.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92312iC7EEC9F63F04714A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_3-1705731305509.png" alt="Bud_3-1705731305509.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;select 
  s.*,
  cast(t_date as char(50)) as test_col
from 
  species_records s&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;Why does casting a date field in the SELECT clause result in a blank column — when the query uses &lt;STRONG&gt;s.*&lt;/STRONG&gt; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jan 2024 06:05:46 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2024-01-22T06:05:46Z</dc:date>
    <item>
      <title>FGDB database view — Casting date as text in SELECT clause results in blank field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/fgdb-database-view-casting-date-as-text-in-select/m-p/1372651#M77688</link>
      <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 3.2.1; file geodatabase&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I can create this FGDB database view without errors:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1705730720694.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92309iE11505079957FBEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1705730720694.png" alt="Bud_0-1705730720694.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;select 
  s.*,
  cast(t_date as char(50)) as test_col
from 
  species_records s&lt;/PRE&gt;&lt;P&gt;However, the field that uses CAST is blank in the attribute table. That's not expected.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't have that problem if I remove &lt;STRONG&gt;s.*&lt;/STRONG&gt;&amp;nbsp;and replace it with the fields listed &lt;STRONG&gt;one by one&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_2-1705731086512.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92311i5679529835365882/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_2-1705731086512.png" alt="Bud_2-1705731086512.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;select 
  objectid,
  t_unique_id,
  t_species,
  t_common_name,
  t_taxon_group,
  t_threat,
  t_grid_refer,
  t_site,
  t_date,
  cast(t_date as char(50)) as test_col
from 
  species_records s&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I don't have the &lt;STRONG&gt;s.*&lt;/STRONG&gt;&amp;nbsp;problem in a mobile geodatabase view (although the date is displayed as a number, not a textual date, but maybe that's expected for SQLite date fields):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_3-1705731305509.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92312iC7EEC9F63F04714A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_3-1705731305509.png" alt="Bud_3-1705731305509.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;select 
  s.*,
  cast(t_date as char(50)) as test_col
from 
  species_records s&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;Why does casting a date field in the SELECT clause result in a blank column — when the query uses &lt;STRONG&gt;s.*&lt;/STRONG&gt; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 06:05:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/fgdb-database-view-casting-date-as-text-in-select/m-p/1372651#M77688</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-01-22T06:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: FGDB database view — Casting date as text in SELECT clause results in blank field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/fgdb-database-view-casting-date-as-text-in-select/m-p/1373070#M77734</link>
      <description>&lt;P&gt;&lt;SPAN&gt;A file-based data including file geodatabases and all content in it that use&amp;nbsp;standardized queries use the ArcGIS SQL dialect that supports a &lt;STRONG&gt;subset of SQL capabilities&lt;/STRONG&gt;. In other words, it has limitations on the SQL expressions that are available in a Data Base Management System such as Oracle or SQL Server. On the other hand, databases or enterprise geodatabases use the SQL syntax of the underlying RDBMS, such as,&amp;nbsp;Oracle,&amp;nbsp;SQL Server,&amp;nbsp;PostgreSQL,&amp;nbsp;SAP HANA, and&amp;nbsp;IBM Db2, where each database uses its own slightly different SQL dialect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So it seems this is known limitation of using the s.* in a database view for a file geodatabase.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 17:57:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/fgdb-database-view-casting-date-as-text-in-select/m-p/1373070#M77734</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2024-01-22T17:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: FGDB database view — Casting date as text in SELECT clause results in blank field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/fgdb-database-view-casting-date-as-text-in-select/m-p/1373942#M77848</link>
      <description>&lt;P&gt;For anyone who's wondering, file geodatabases also support the SQL syntax mentioned on this page:&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-file-gdb/sql-reporting-and-anlysis-file-geodatabases.htm" target="_self"&gt;SQL for reporting and analysis on file geodatabases&lt;/A&gt;&lt;/P&gt;&lt;P&gt;That document mentions that aliases are supported. &lt;STRONG&gt;s.*&lt;/STRONG&gt; is an alias. Yes, it only mentions column aliases, but it seems like table aliases are generally supported too.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;s.*&lt;/STRONG&gt; works in other FGDB SQL scenarios, such as the database view in this post:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/selecting-the-most-recent-records-based-on-unique/m-p/1369899/highlight/true#M77380" target="_self"&gt;Selecting the most recent records based on unique values in another field&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 04:04:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/fgdb-database-view-casting-date-as-text-in-select/m-p/1373942#M77848</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-01-30T04:04:25Z</dc:date>
    </item>
  </channel>
</rss>

