3

In QGIS 2.4, i am unable to set the default value as NULL if i have not updated any value on date fields. Its automatically taking the current system date. I am expecting to set the default values(NULL) for date fields in properties of layer, since that default values should be displayed while capturing the new feature itself. It may be edited if required. Please refer the attached screen shots.

enter image description here enter image description here

  • You want to change all fields from the current date to 'NULL'? – Joseph Jul 8 '14 at 12:07
  • I want to set the default value as NULL before i update any specific date on those fields and not for all fields and features. – Mahi Jul 8 '14 at 13:21
4

Open up the layer's Attribute Table > Toggle editing mode. Select the fields you want changed then open the Field Calculator. Check the Only update selected features box at the top.

Assuming you already made a column for the Date, check the Update existing field box and select the required field. Then in the expression box, enter NULL.

enter image description here

  • I am expecting to set the default values(NULL) for date fields in properties of layer, since that default values should be displayed while capturing the new feature itself. It may be edited if required. Please refer the below screen shots. – Mahi Jul 10 '14 at 7:09
  • Just for clarity, you want your date columns ('InstallationDate' and 'InServiceDate') to show NULL for ALL features? – Joseph Jul 10 '14 at 9:19
  • Initially by default it should show NULL while capturing for all features and then i may update any date for some features when i required other features still should show the NULL in date columns ('InstallationDate' and 'InServiceDate'). – Mahi Jul 10 '14 at 14:03
  • I still think what that what I suggested (opening Field Calculator and creating or updating Date columns) would do that for you instead of editing the widget attributes. All fields would then have NULL as their date and you could update any fields manually as you mentioned. I can re-edit my post with more images for a step-by-step guide if you prefer? – Joseph Jul 10 '14 at 14:18
  • I know about Field calculator method but what i'm saying is in QGIS 2.4 when we capture the new features its automatically showing the current date by default and also we are unable to remove that date to NULL values manually, since i may update any valid dates on some features and i may leave the field without updating any date value on some features. On this situation we are unable to know which features should be changed to NULL by using Field calculator method. So that i'm expecting to set default values as NULL for all features if i have not updated any dates but its not as of now. – Mahi Jul 10 '14 at 14:46
3

My reading of your question suggests that you are wanting to report what you perceive to be a bug in QGIS 2.4.

I have no plans to test that personally, but from reading what you have presented it looks to me like it could well be one.

I recommend that you report it to the QGIS Development team who say:

If you find a bug, please report it!

You need an OSGeo account and login in order to submit bug reports. To get started, first create Create an OSGeo4 account.

Once you have your account, use QGIS issue tracking to search if the issue you’d like to report is probably [sic] already entered.

In the meantime it looks like @joseph has provided you with an acceptable workaround in his answer.

Please be aware (from our GIS SE Help) that:

We are not a GIS Software Support Site. We encourage you to seek official routes for support for specific issues you may have.

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.