Query Regrading N1ql Query



I want the query to get the count of last day transactions.So I’m trying to get the info based on current date -1 day.Can any one can how to do achieve this.I’m trying to check the date functions but there is no examples to use.DATE_DIFF_STR(expression1, expression2, part) this is the function I’m trying to use.
I need to substract currendate-1 so that we will get yesterday right

Thanks in advance

Kartheek gummaluri


Hi @kartheek91,

Did you have a look at the Date Functions in documentation (http://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/datefun.html)?

Looking at DATE_DIFF_STR:

DATE_DIFF_STR(expression1, expression2, part)

It seems like you want to supply the two dates as expression1 and express2, and use “day” as the part.


DATE_ADD_STR( NOW_STR(), -1, “day” )