Timeline for Coverting text from one Column to a year date format in another column in QGIS
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 14, 2017 at 13:35 | history | tweeted | twitter.com/StackGIS/status/852877900466532353 | ||
| Apr 12, 2017 at 11:44 | vote | accept | ThunderSpark | ||
| Apr 12, 2017 at 11:33 | answer | added | Kazuhito | timeline score: 3 | |
| Apr 12, 2017 at 9:29 | comment | added | Joseph | @Kazuhito - Kindly post your comment as an answer but replace to_date(concat("LC", '-01-01') with to_date("LC" || '-01-01') since you pretty much got it right :) | |
| Apr 12, 2017 at 9:17 | comment | added | Joseph | Try using to_date("LC" || '-01-01') instead. This ignores NULL values. | |
| Apr 12, 2017 at 6:25 | history | edited | ThunderSpark | CC BY-SA 3.0 | added 92 characters in body |
| Apr 11, 2017 at 22:46 | comment | added | Kazuhito | By the way you can edit your question to highlight that your LC has NULL to gain more attention to the issue. | |
| Apr 11, 2017 at 15:04 | comment | added | Kazuhito | Not a clean way, but probably I would put something like CASE WHEN length("LC") < 1 THEN to_date('1111-01-01') ELSE to_date(concat("LC", '-01-01')) END and deal with the dummy (Year 1111) afterwards... | |
| Apr 11, 2017 at 14:16 | comment | added | ThunderSpark | ...Um your case I think will work but the problem is that some value's in LC column are NULL causing an error to occur. How do i get past that then? | |
| Apr 11, 2017 at 13:44 | comment | added | Kazuhito | You are right, sorry. Only way I can think of is (1) create or update "LC_Datum" field by an expression to_date(concat("LC", '-01-01')) and then (2) Open Layer Properties | Fields and click on [Text Edit] to change the widget to Date/Time which allows custom to yyyy format. | |
| Apr 11, 2017 at 12:48 | comment | added | ThunderSpark | No It does not work for me because the I says the expresion is not vallid. It cannot convert it to Date Time format... | |
| Apr 11, 2017 at 11:18 | comment | added | Kazuhito | Expression year("LC") could work? | |
| Apr 11, 2017 at 10:49 | history | asked | ThunderSpark | CC BY-SA 3.0 |