Volatil3
Volatil3

Reputation: 14998

Quickbooks Online REST API: Is it possible to apply Date functions in the SQL query?

I want to retrieve invoices in which date difference between today and DueDate is > 1 or more. Is there anyway to apply some kind of DateDiff?

I'm using the QuickBooks Online API indicated here:

And issuing an SQL query via their REST API like this:

Operation: GET /v3/company/<realmID>/query?query=<selectStatement>
Content type: application/text

Where my <selectStatement> is something like:

SELECT * FROM Invoice

I need the equivalent to something like this that I'd do in MySQL:

SELECT * FROM Invoice WHERE DATEDIFF(NOW(), DueDate) > 1

Can I do that with Intuit's SQL-like query REST API?

Upvotes: 2

Views: 327

Answers (1)

Keith Palmer Jr.
Keith Palmer Jr.

Reputation: 27982

If you refer to Intuit's docs, it shows what is filterable.

Relevant:

DueDate:
optional
Date, filterable, sortable

There is no "date difference" type function available. Intuit's limited SQL-like query language does not support it.

You may also wish to check out the A/R Aging reports, which are specifically geared towards things like finding overdue invoices (which is what it sounds like you're trying to do).

Example:

Upvotes: 2

Related Questions