unable to get the BigCommerce orders by descending using API v2 - api

We are trying to get the orders from BigCommerce using API V2. WE have applied the filter but its not working
$filter = array('min_date_created' => 'Tue, 14 JAN 2019 00:00:00 +0000');
How can we get the orders by descending order?

To sort the orders by ascending use: https://api.bigcommerce.com/stores/{store_hash}/v2/orders?sort=date_created:asc
Dates should be in RFC-2822 or ISO-8601 date format.
To sort by asc and max_date_created use:
https://api.bigcommerce.com/stores/{store_hash}/v2/orders?sort=date_created:asc&max_date_created=2018-01-11
You can review the filters available here: Orders API

Try the following:
https://api.bigcommerce.com/stores/{{store_hash}}/v2/orders?min_date_created={{min_date_created}}&sort=date_created:desc
Where {{store_hash}} is the BigCommerce Store Hash and {{min_date_created}} is the date formatted like 2017-01-10T06:54:07Z.
This will present the orders created after the date variable and sorted in descending order (most recent first).

Related

How to get list of dates in ascending order in .NET with MS Access

I am doing small project in VB.NET with MS Access. I am trying to get list of dates in ascending order. Hence I am using this query:
select billdate from invoice order by billdate asc
Actually There is a List of Date in MS Access Table
22-Oct-2014
09-Sep-2014
10-Sep-2014
01-Oct-2014
Using the above query, I got result like this
01-Oct-2014
09-Sep-2014
10-Sep-2014
22-Oct-2014
Its wrong. Its considering date only, not month and year.
I need result like this
09-Sep-2014
10-Sep-2014
01-Oct-2014
22-Oct-2014
What should I do? Please help me to finish this task.
You could try this:
select billdate from invoice order by CDate(billdate) asc

Oracle SQL get list of unique dates

Alright, I'm stumped here. I'm trying to get a list of only unique dates from the following table:
SALES(OUTLET_NUMBER, EMP_NUMBER, CUSTOMER_ID, PRODUCT_CODE, SALE_DATE, SALE_TIME, quantity)
But when I try the statement:
SELECT SALE_DATE
FROM sales
GROUP BY
SALE_DATE;
It does not remove already existing dates.
SALE_DATE
20-MAR-14
19-MAR-14
20-MAR-14
20-MAR-14
01-DEC-13
19-MAR-14
This is the output from oracle. Why does it sill display 3 versions of 20-MAR-14 and what can I do to get it to give me only unique dates?
In Oracle, the date data type rather misleadingly also contains a time. The easiest way to do what you want is using trunc(), although you could also format the date as a string using to_char().
Try this:
SELECT trunc(SALE_DATE) as sale_date
FROM sales
GROUP BY trunc(SALE_DATE)
ORDER BY trunc(SALE_DATE);
The date type in Oracle also stores the time. When you print out the dates you've queried they are transformed to strings according to your default date format. Since it seems to be dd-mon-yy, you don't see their time part, and it seems like you have duplicates.
You could, for instnace, remove the time part by using the trunc function:
SELECT DISTINCT TRUNC(sale_date) FROM sales

Not Getting All Records In a Query

I'm using a GoDaddy-based SQL Server 2005 to store sales from a web site. I have a datePaid column that is formatted as smalldatetime. When I query the database to display all orders for a certain date, using this query:
SELECT DISTINCT
purchase.orderID, wfRegister.firstName, wfRegister.lastname,
storeOrder.subtotal, storeOrder.handling, storeOrder.total,
storeOrder.datePaid, storeOrder.dateOrdered, storeOrder.paypalID
FROM
wfRegister
INNER JOIN
(storeOrder INNER JOIN purchase ON storeOrder.orderID = purchase.orderID) ON wfRegister.customerID = storeOrder.customerID
WHERE
storeOrder.deleted = 0
AND storeOrder.datePaid BETWEEN '03/21/2013' AND '03/21/2013'
ORDER BY
storeOrder
I only get one record returned for the 21st, which is not correct. If I change the query to storeOrder.datePaid BETWEEN '03/21/2013' AND '03/22/2013 I get 7 records returned for the 21st, which is correct, but then I also get records from the 22nd, which I don't want. Is there a way to query the datePaid field for the 21st and get all 7 records returned and not just 1? My client imports the data into Excel and does not want to have to delete the records from the 22nd to get all the records from the 21st
For date arithmetic in SQL Server using strings, I would recommend to always use the ISO-8601 standard format: YYYYMMDD - this is the only format that is independent of any regional and/or language settings.
To reliably get all orders from a given day, you should use
AND storeOrder.datePaid >= '20130321' AND storeOrder.datePaid < '20130322'
The BETWEEN seems handy - but it's inclusive, e.g. you get the data from the 22nd of March, too.
This clause here gives you all records from the 21st of March, regardless of their time - but nothing from the 22nd.

Help needed bubbling up relevant records with most recent date

I've got 5 records in Lucene index.
a.Record 1 contains--tax
analysis.Date field value is March
2009
b.Record 2 contains--Senior tax
analyst.Date field value is Aug 2009
c.Record 3 contains--Senior tax
analyst.Date field value is July 2009
d.Record 4 contains--tax analyst.Date
field value is Feb 2009
e.Record 5 contains--Senior tax
analyst.Date field value is Oct 2009
If the input keyword is senior tax analyst,then search results should come up in the following order:
a.Record 5--because this record is
has got the most recent date and has
got the matching phrase
b.Record 2--because this record has
got second most recent date and has
got the matching phrase
c.Record 3--because this record has
got third most recent date and has
got the matching phrase
d.Record 4
e.Record 1
Basically,I want to show the most relevant records grouped by date and sorted in descending order by date.And then, I want to show remaining records sorted by descending value of relevancy.
How do i achieve this with Lucene?
Please help.
Thanks for reading.
I believe you can do this by first collecting the search results and then sorting them using a CustomSorter. This blog entry explains custom sorting in Lucene Java. You have to translate this to .Net, using .Net's ScoreDocComparator. Your compare() method will have to get the date fields from the documents and compare them. I would first try to get the proper order for the exact matches (Record 5, 2, and 3). Later, you can use the match as well in your comparator. You can generalize my answer to this question in order to do this.

MySql 'Order by Date' Question

Im pulling data from a MySql data table. I'm pulling from a row called 'PubDate' (meaning Published date). This format is in Date format, not DateTime. When I execute the query
Select * from Articles order by pubDate ASC
Its ordered by date as so:
1.09/18/09
2.09/18/09
3.09/19/09
4.09/20/09
If possible I would like to be able to get the most recent date first by using the 'ASC' value for direction due to my current code logic. I've already tried
Select * from Article order by Cast(pubdate as datetime) ASC
but didn't change the output. I CAN do DESC (descending order) if I must...but its not preferable.
the most recent date first
For this you must use DESC.
if you want your newest articles to be first use DESC. default is ASC so there is no point in explicitely adding it