Fetch last 5 days record in orientdb

60 views
Skip to first unread message

Ramachandran Pandiyan

unread,
Jan 6, 2015, 2:35:19 AM1/6/15
to orient-...@googlegroups.com

Hi sir,

    Fetch last 5 days record in orientdb using date i am mention, please give query for that.. kindly need your help

    Example: 
     suppose i give date like '2015-01-06' so i want return that date minus 5 days record

    Waiting for your reply

   Thanks,
    Ram

Dan Andrei

unread,
Jan 7, 2015, 3:53:15 AM1/7/15
to orient-...@googlegroups.com
I do something like this in python 

yesterday = datetime.now() - timedelta(days=1)
query2 = client.command("SELECT count(*) FROM User WHERE updated_at >= date('" + str(yesterday.strftime('%y-%m-%d')) + "', 'yyyy-MM-dd')")

Basically you have to get the "string" of '%y-%m-%d' then you just compare it to be bigger than "now()" 

Ramachandran Pandiyan

unread,
Jan 7, 2015, 4:38:24 AM1/7/15
to orient-...@googlegroups.com
Thank you...

--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/EG_fjs_CmzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks...
 Ram
Reply all
Reply to author
Forward
0 new messages