How to get all products that have been created within H number of hours using flexible query in hybris?

Viewed 189

Can anyone please suggest a flexible query to get all products which have been added within H number of hours in hybris?

1 Answers

You can use SQL functions.

This should work for SQL Server:

SELECT * FROM {Product} WHERE {creationtime} > DATEADD(mi,-60,GETDATE())

The DATEADD portion means means subtract 60 minutes from the current date.

For other databases, you may need to look for a similar or equivalent function.

Related