All Forums General
dataminering 2 posts Joined 06/15
23 Jul 2015
Querying the data between 2014 and current date

Hi all,
I have some problem about the query which finds the data between 2013-12-31 and today
I took invalid timestamp error.
The query I used looks like this:
select * from table1 where the_date between '2013-12-31' and current_time
Please help me!

Shoushounette 9 posts Joined 01/14
23 Jul 2015

I didnt understand whats the error excately but i think you can use:... where CAST(the_date AS DATE) between '2013-12-31' and CURRENT_DATE
Note: current_time gives the what time is now, current_date gives what day today.

dnoeth 4628 posts Joined 11/04
23 Jul 2015

where the_date between DATE '2013-12-31' and current_DATE


dataminering 2 posts Joined 06/15
23 Aug 2015

Thanks for your replies,
Actually, I had not made a query with a timestamp before I met such a situation. Now I found a solution with parsing EXTRACT and CAST keywords.

You must sign in to leave a comment.