Hello,
I want to return all objects created on a date by query. How can I do that?
I tried this but it didn't work :
select object_name from dm_document where r_creation_date = date('26/07/2012', 'dd/MM/yyyy')
Mel
If there are Accepted Answers, those will be shown by default. You can switch to 'All Replies' by selecting the tab below.
So you actually have a document that was created at midnight that you want to pull back? If so, then just include time format. Your original post did not say this.
select object_name from dm_document where r_creation_date = date('26/07/2012 00:00:00', 'dd/MM/yyyy hh:mm:ss')
try using r_creation_date > Date() and r_creation_date < Date().
PS: Content server stores the timestamp as well
Date is actually time data type, so your query will only return objects created exactly at midnight on that date. Try this DQL instead:
select object_name from dm_document where r_creation_date >= date('26/07/2012', 'dd/MM/yyyy') and r_creation_date < r_creation_date >= date('27/07/2012', 'dd/MM/yyyy')
Error occured during query execution :[DM_QUERY_E_SYNTAX]error: "A Parser Error (syntax error) has occurred in the vicinity of: select object_name from dm_document where r_creation_date >= date('26/07/2012', 'dd/MM/yyyy') and r_creation_date < r_creation_date >="
I did tried with this but as Johnny said it does not return objets created exactly at minight on that specific date
Copy/paste error, I guess :-)
This should work better:
select object_name from dm_document where r_creation_date >= date('26/07/2012', 'dd/MM/yyyy') and r_creation_date < date('27/07/2012', 'dd/MM/yyyy')
Oops - need more coffee this morning
Nopes does not work.. It still does not return objects created at midnight!
I want to include all documents created on that specific date, so I will include the time too.
Thank you for your answers