How can we subtract 7 days from date


We have date-time stored in document with following format-

“__at”: 20200619091954, “zname”: “Albania”

How can we subtract 7 days with shared date&time format using N1QL?
Sample query used to get o/p is: select zname, __at from config a where a.__t=‘ntr-zonem’ and zname = 'Albania

Can someone please help to achieve it.


SELECT DATE_ADD_STR(CONCAT(SUBSTR(d,0,4),"-",SUBSTR(d,4,2),"-",SUBSTR(d,6,2),"T",SUBSTR(d,8,2),":",SUBSTR(d,10,2),":",SUBSTR(d,12,2)),-7,"day") AS date
 LET d = "20200619091954";