3

I'm trying to put a query on a vectorlayer with the current date.

The following code works, but I want the current date to be dynamic:

cast ("Starttijdstip" as character) <  '2018/03/01' AND  '2018/03/01' < cast ("Eindtijdstip" as character)

In 'Select by expression' I can use now(), is there something similar in the query builder (layer provider feature filter)?

The layer is a json-file that looks like this: {"type":"FeatureCollection","features":[{"geometry":{"coordinates":[[[105888.024, 194338.859], [105808.912, 194312.488], [105773.752, 194365.23], [105756.171, 194417.971], [105672.664, 194690.468], [105536.415, 195151.955], [105391.377, 195644.208], [105927.58, 194813.532], [105940.766, 194395.996], [105888.024, 194338.859]]],"type":"Polygon","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::31370"}}}, "type":"Feature", "properties":{"....

  • 1
    If you are referring to the layer provider feature filter / query, the answer depends on the layer provider, i.e. whether it is a PostGIS layer, Shapefile, or something else. – underdark Mar 4 '18 at 20:05
  • Yes, i'm referring to the layer provider feature filter/query. The layer is a json-file with coördinates (the layer has geometry like a shapefile). – Laurens Mar 5 '18 at 20:34
  • @underdark The json-file looks like this: {"type":"FeatureCollection","features":[{"geometry":{"coordinates":[[[105888.024, 194338.859], [105808.912, 194312.488], [105773.752, 194365.23], [105756.171, 194417.971], [105672.664, 194690.468], [105536.415, 195151.955], [105391.377, 195644.208], [105927.58, 194813.532], [105940.766, 194395.996], [105888.024, 194338.859]]],"type":"Polygon","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::31370"}}}, "type":"Feature", "properties":{".... – Laurens Mar 5 '18 at 20:38
  • Please edit the question text to add this extra information. – underdark Mar 5 '18 at 20:44

Your Answer

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

Browse other questions tagged or ask your own question.