[GIS] GeoServer: Creating CQL-filter which only filters dates for given weekday

cql-filtergeoserver

I use a GeoServer which i query over Openlayers with WMS and CQL.

I have a date field in my database which i want to filter with
CQL.

I want only have Dates which has the weekday monday.

The Result would contain only two dates.

id   time   
1    12.10.2015 12:26:31
2    19.10.2015 13:45:00
3    20.10.2015 12:16:11
4    21.10.2015 12:03:45
5    22.10.2015 12:01:45

I don't see any way to do that. Are the some functions to do that?
I was thinking of use a formular to calculate the weekday, but therefore i need the day, month, year and century from a date and i don't see any way to extracts this values.

Best Answer

If it is your own GeoServer and database you can create a weekday attribute by making a new layer through SQL View http://docs.geoserver.org/stable/en/user/data/database/sqlview.html

Select the weekday from from the date column with SQL

select to_char(DATE '2001-02-16','Day')
Friday

http://grokbase.com/t/postgresql/pgsql-general/0898jbyc4z/…;. – user30184 6 mins ago

Related Question