postgresql - How define today date with Default timestmp -


i using postgressql wish data currentdate, want filter data based on date in data base plandate filed define time stamp time zone showing format 2013-09-01 03:22:01.438348+05:30 query this

 select ttodoid ,date,details ttodo date=currentdate(): 

but currentdate function giving me date '2013-10-06' based on result no rows how can manage today date detail

updated: 1 way it

select *   ttodo  date between date_trunc('day', current_timestamp)                  , date_trunc('day', current_timestamp)                    + interval '1 day'                    - interval '1 microsecond'; 

or

select *    ttodo  date >= date_trunc('day', current_timestamp)     , date <  date_trunc('day', current_timestamp)               + interval '1 day'; 

here sqlfiddle demo


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -