romain974 / qspatialite

Automatically exported from code.google.com/p/qspatialite
3 stars 2 forks source link

Date fields are imported as PyQt4.Core.Qdate objects #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi (bonjour Romain), 

In versions  7.0.2 et 7.0.1, on QGIS 2.2, we can't import correctly date 
fields. They are converted to  PyQt4.Core.Qdate text objects. 
See attached image. 
Quite a severe bug preventing us from using Qspatialite. 

Cheers 
Régis

Original issue reported on code.google.com by regis.ha...@gmail.com on 20 Mar 2014 at 3:35

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

Have you tried to make a query based on the date field ? It should be working.
Idem when lloading data to QGIS canvas.
It's only a display bug I guess.

Can you try and let me know the results ?

I'll have a look a this soon.

Original comment by romain.r...@gmail.com on 21 Mar 2014 at 10:32

GoogleCodeExporter commented 9 years ago
Fixed in new version

Original comment by romain.r...@gmail.com on 6 Feb 2015 at 8:03

gispoole commented 7 years ago

Hi, I'm having this issue again in QGis 2.14.

I'm using Qspatialite version 7.0.4 in QGis 2.14. We use QSpatialite to save selected polygons from an MSSQL (2008) layer into spatialite databases.

Since Qgis 2.14 we have noticed that any dates held in the SQL table as a date data type are corrupted when the data is imported into a spatialite database through QSpatialite.

Original Data from MSSQL layer within QGis: before_spatialite

Data after importing into spatialite database using QSpatialite: after_spatialite

N.B the field name is the data type used to create the table in MSSQL.

I have tried using the DB manager and this fails stating 'Error 5 - creation of fields failed'

We currently have a workaround that involves using QGis 2.8 to import the layer and then opening it through QGis 2.14 to continue editing, this doesn't corrupt the data.

I'd be grateful of any help. Let me know if I need to log a new issue, Thanks!

see: https://gis.stackexchange.com/questions/251055/qgis-qspatialite-plugin-corrupting-dates-when-importing-layers/251107#251107