Home Select data between dates from oracle (date type)
Reply: 0

Select data between dates from oracle (date type)

user1412
1#
user1412 Published in May 22, 2018, 9:23 pm

I have this data in my DB and I want only select between days (not inclusive. From this data, only want extrac from day 14.

ID          REFERENCE       REQUEST_DATE (TYPE DATE)
2141777690  1500541052868   14/04/18
2141777750  1500541052868   14/04/18
2141777810  1500541052868   14/04/18
2141777870  1500541052868   14/04/18
2141777930  1500541052868   14/04/18
2141778080  1500541052868   14/04/18
2141778470  1500541052868   13/04/18
2141778590  1500541052868   13/04/18
2141778980  1500541052868   13/04/18
2141779010  1500541052868   13/04/18
2141779100  1500541052868   13/04/18

I tried this (11 results):

select count(entitypoll0_.ID) as col_0_0_ from MY_TABLE entitypoll0_
where entitypoll0_.POLL_ID=1500541052868 
and entitypoll0_.REQUEST_DATE > TO_DATE('2018-04-13','YYYY-MM-DD') 
and entitypoll0_.REQUEST_DATE < TO_DATE('2018-04-15','YYYY-MM-DD')

I tried this (11 results):

select count(entitypoll0_.ID) as col_0_0_ from MY_TABLE entitypoll0_
where entitypoll0_.POLL_ID=1500541052868 
and (entitypoll0_.REQUEST_DATE between TO_DATE('2018-04-13','YYYY-MM-DD') and TO_DATE('2018-04-15','YYYY-MM-DD'));

By the way, I only have 5 results on the day 14, what I making wrong? I are not saving the time and I thought that this should be enough for this type of query.

Thanks

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.316469 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO