cancel
Showing results for 
Search instead for 
Did you mean: 

What is the FlexibleSearchQuery to fetch products that are staged, approved and are modified between some time ?

0 Kudos

I need to write a custom dao the allows me to fetch product that are staged, approved and are modified between a timeline but i'm not sure what query i'm supposed to write. Someone please help

0 Kudos

Please help... Immediate help is needed

Accepted Solutions (0)

Answers (1)

Answers (1)

mpern
Employee
Employee
0 Kudos

Quite frankly, I shouldn't even answer such a basic question. If you would ask a similar basic question on Stackoverflow, they would troll you like there is no tomorrow.

But, since I'm bored:

 select {p:code}, {c:id}, {v:version}, {p:modifiedTime} 
 from {product as p join catalogversion as v on {v:pk} = {p:catalogversion} join catalog as c on {v:catalog} = {c:pk}}
 where {v:version} = 'Staged'
 and {p:modifiedTime} >= "2018-09-12 00:00:00"
 and {p:modifiedTime} <= "2018-09-13 23:59:00"

The timestamps are specific to the database you use, those above work for MySQL.

And next time, think for yourself first.

0 Kudos

Thank you.