How to add a date range in BrewwQL

BrewwQL is a powerful function in Breww that allows for filtering of data across multiple areas such as customers, sales and reporting to present precise and accurate data. One feature of BrewwQL is the ability to set custom & dynamic date ranges. In this post, as an example, we’ll go over getting all customers who’ve ordered over 1 month ago but less than 3 months ago.

Go to Customers and click on the + Add filter button in the BrewwQL box. This will present a choice of options of filters but for this example, ‘Last order date’ has been selected.

image

From here, you can then select the first part of your date range by entering your date (dates can be entered in the format DD/MM/YYYY (e.g. “29/03/2022”) or as relative dates, such as “3 months ago”). For the example above, we are going to enter ‘1 month ago’ and select ‘Last Order Date is older than or equal to 1 month ago’.

image

BrewwQL has the ability to add multiple concurrent filters into the query. This is how you would select your second date in the range. For the example above, you will want to add a ‘Last activity date’ of ‘3 months ago’. To continue this example, select an order date of ‘Last order date is more recent than or equal to 3 months ago’.

image

This should give you a BrewwQL query string that looks like something like this:

last_order_date <= “1 month ago” and last_order_date >= "3 months ago"

You can see the separate queries joined by the ‘and’ keyword.

If you have any questions or need help forming a query, please let us know.