In QGIS I open a geodatabase and save one layer to a SHP file to work on. I use the "Save Layer As" option with the default settings. However I discovered that the SHP Field data type changes, in particular a "Date" type is saved to a "Text" type. I only discovered the issue when I was trying to use the field calculator and there were issues when using text in calculations.

Is there a setting I am missing that maintains the original data types.

Original Data Type from ArcCatalogue enter image description here

QGIS data type enter image description here

  • Before opening QGIS, you could have check what ArcCatalog tells you when you open your SHP.
    – etrimaille
    Jan 15 '20 at 6:49

Shapefiles can store dates only in the format YYYY-MM-DD (shapefile is a very old dBase format storing dates with four bytes). A geodatabase format from ArcMap/ArcCatalog has the format 2019-01-15T07:33:12.000 which stores also the time. Exporting to shapefile stores your geodatabase date to a string, then you don't loose information. You can use geopackage instead, which will convert the geodatabase date into a QDateTime format which is the same like in ArcCatalog.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.