Querying the data between 2014 and current date

General

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!

3 REPLIES
Enthusiast

Re: Querying the data between 2014 and current date

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.

Cheers,

S

Senior Apprentice

Re: Querying the data between 2014 and current date

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

Re: Querying the data between 2014 and current date

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.