1

I want to select records from date with a specific date. The problem is there is timestamp in the date. For example:

Table name : books
record 1 : 09-04-2018 10:31:00
record 2 : 09-04-2018 10:32:00
record 3 : 09-04-2018 10:33:00
record 4 : 10-04-2018 17:54:00
record 5 : 10-04-2018 18:49:01

I want to retrieve all records on date 09-04-2018 irrespective of the time.

select * from books where bookdate >= '09-04-2018' => This query is returning me all 5 records instead of 3.

1 Answer 1

1

I guess the problem is column/literal datatype:

select * from books where date::date >= '2018-04-09'::date;

" I try your query, still it returns all 5!"

Well, 2018-04-09 00:00:00 is smaller than all your 5 values.

Sign up to request clarification or add additional context in comments.

1 Comment

the datatype is timestamp. I try your query, still it returns all 5!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.