Jump to content

Selecting date on postgresql


Recommended Posts

I have date column on postgresql table with timestamp format i.e "2017-01-01 22:00:00". Does anybody know how to select those date column without put the hour on the queries?

What I type for selecting those date is  "select date from table where date='2017-01-01' " but nothing appear on the result. 

Look forward to hear from you guys !! 

regards

Link to comment
Share on other sites

Still doesn't work for me.., here is my Table. As alternative I use the query below, but not a simple once in my opinion:

Quote

SELECT* FROM table WHERE date BETWEEN '2017-01-01 00:00:00' AND ' '2017-01-01 23:00:00 '

just in case If I have datetime column on this format "yyyy-mm-dd hh:mm:ss" as timestamp column type.Literally will it works to select the date column by only write query below:

Quote

SELECT*FROM table WHERE date = '2017-01-01'

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.

Disable-Adblock.png

 

If you enjoy our contents, support us by Disable ads Blocker or add GIS-area to your ads blocker whitelist