Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8566393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:38:41+00:00 2026-06-11T17:38:41+00:00

I am supposed to select all the persons born in July (or 07). This

  • 0

I am supposed to select all the persons born in July (or 07). This did not work:

select * from people where date_trunc('month',dob)='07';

ERROR: invalid input syntax for type timestamp with time zone: “07”
LINE 1: …ct * from people where date_trunc(‘month’,dob)=’07’;

What is the right way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:38:43+00:00Added an answer on June 11, 2026 at 5:38 pm
    select * from people where to_char(dob, 'MM') = '09';
    

    gives you all people who where born in September, if the date of birth is stored in a timestamp table column called ‘dob’.
    The second param is the date format pattern. All typical patterns should be supported.
    E.g.:

    select * from people where to_char(dob, 'MON') = 'SEP'; 
    

    would do the same.

    look here for timestamp format patterns in Postgres:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to select all the fields from the 'jobseeker' table and
Suppose I am calling a query SELECT name, city, country FROM People. Once I
Suppose I want to do SELECT persons.name, cars.registration FROM persons, cars WHERE persons.state=cars.state AND
For the this task I'm supposed to find all the names of actors who
Here is HTML code. It supposed to select all text in Container div <B
are all the formtastic input types supposed to work when using the gem 'formtastic-bootstrap'
We're having the problem that all types of people that aren't supposed to (like
this code wont run it supposed to fill the datagridview some data but all
I'm working with a mysql query that is supposed to select all messages addressed
Even after all the hotfixes and updates that are supposed to fix this, my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.