AI Reports

Magento 2 SQL queries › Products and catalogue

Which products were added in the last 30 days?

Short answer: The product grid has no creation-date column by default. catalog_product_entity.created_at has it.

In the Magento admin

  1. Sort the product grid by ID, highest first; new products usually have the highest IDs.

With one query

These queries only read data. Run them on a copy of your database if you can, or ask your developer to. If your tables have a prefix (set in app/etc/env.php), add it to each table name.

Magento Open Source

SELECT e.sku, e.type_id AS type, e.created_at
FROM catalog_product_entity e
WHERE e.created_at >= NOW() - INTERVAL 30 DAY
ORDER BY e.created_at DESC;

Adobe Commerce

Product, category, rule and CMS values are stored per version and joined on row_id (why):

SELECT e.sku, e.type_id AS type, e.created_at
FROM catalog_product_entity e
WHERE e.created_at >= NOW() - INTERVAL 30 DAY
  AND e.created_in <= UNIX_TIMESTAMP() AND e.updated_in > UNIX_TIMESTAMP()
ORDER BY e.created_at DESC;

Good to know

Related

Gaurav Harsh

Gaurav Harsh is a Magento developer who works on large Adobe Commerce stores and builds AI Reports, a Magento extension for asking your store's data questions in plain English. LinkedIn