may-z
may-z

Reputation: 127

Dynamic dates in where parameter

Am I able to use a dynamic date range for the "where" parameter? I'd like to get all the data changed in the last 30 mins.

All I can find in the documentation is using static dates: https://developer.xero.com/documentation/api/requests-and-responses

Upvotes: 1

Views: 359

Answers (1)

Shereen
Shereen

Reputation: 139

You could try using the query string in the Where Clause. For Ex.

   string querystr = "Date >= " +
                                "DateTime(" + dateFrom.Year.ToString() + ", 
   " + dateFrom.Month.ToString() + ", " + dateFrom.Day.ToString() + ") " +
                                "&& Date <= " +
                                "DateTime(" + dateTo.Year.ToString() + ", " 
   + dateTo.Month.ToString() + ", " + dateTo.Day.ToString() + ")";

Passing this querystring to retrieve user defined date rage Invoices

Upvotes: 1

Related Questions