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

  • Home
  • SEARCH
  • 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 7921689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:40:48+00:00 2026-06-03T16:40:48+00:00

I have a column named thedate that is varchar. An example of a row

  • 0

I have a column named thedate that is varchar. An example of a row is:

Feb 29

I want to convert this value to a date because I want to compare it to today. I have tried to_date but I’m getting a strange value:

0001-01-29 BC

I want it to be 2012-02-29. Any idea why it is not working? I thought it would automatically put in the current year for me and for some reason the month is one behind. It is also listing BC which is not needed.

select to_date(thedate, 'YYYY-MM-DD') from market;
  • 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-03T16:40:50+00:00Added an answer on June 3, 2026 at 4:40 pm

    If the data in the field is really “Feb 29”, you’re going to have to fill in the year yourself. That’s why it’s giving you 1 BC. Try this or replace ‘2012’ with a function to get the current year.

    select to_date(‘2012 ‘||thedate, ‘YYYY MON DD’) from market;

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

Sidebar

Related Questions

I have a column named updatetime that is a timestamp . So, for example,
I want to create a table that has a birthday date, this column shouldn't
I have ten or more(i don't know) tables that have a column named foo
I have a books model with a date type column named publish_date. On my
I have a simple entity class that has a Date property. This property corresponds
I have this sp. I just found out that M.MDS_FILE column, contains a file
I have question that if I have date as string in one column of
I have daily scheduled task that queries a table which includes column named AttemptDate
I have in a MySQL table a DATE column that represents the date in
I have a JQGrid that has a date column. I use the date formatter

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.