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 3597320
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:06:10+00:00 2026-05-18T20:06:10+00:00

Is there any single msql query which can update customer DOB? I want to

  • 0

Is there any single msql query which can update customer DOB?
I want to update the DOB of those customers which have DOB greater than current date.
example:- if a customer have dob 2034 update it to 1934 , if have 2068 updated with 1968.

There was a bug in my system if you enter date less than 1970 it was storing it as 2070.
The bug is solved now but what about the customers which have wrong DOB. So I have to update their DOB.

All customers are stored in customer_entity table and the entity_id is the customer_id

Details is as follows:-

desc customer_entity
    -> ;
+------------------+----------------------+------+-----+---------------------+----------------+
| Field            | Type                 | Null | Key | Default             | Extra          |
+------------------+----------------------+------+-----+---------------------+----------------+
| entity_id        | int(10) unsigned     | NO   | PRI | NULL                | auto_increment | 
| entity_type_id   | smallint(8) unsigned | NO   | MUL | 0                   |                | 
| attribute_set_id | smallint(5) unsigned | NO   |     | 0                   |                | 
| website_id       | smallint(5) unsigned | YES  | MUL | NULL                |                | 
| email            | varchar(255)         | NO   | MUL |                     |                | 
| group_id         | smallint(3) unsigned | NO   |     | 0                   |                | 
| increment_id     | varchar(50)          | NO   |     |                     |                | 
| store_id         | smallint(5) unsigned | YES  | MUL | 0                   |                | 
| created_at       | datetime             | NO   |     | 0000-00-00 00:00:00 |                | 
| updated_at       | datetime             | NO   |     | 0000-00-00 00:00:00 |                | 
| is_active        | tinyint(1) unsigned  | NO   |     | 1                   |                | 
+------------------+----------------------+------+-----+---------------------+----------------+
11 rows in set (0.00 sec)

And the DOB is stored in the customer_entity_datetime table the column value contain the DOB. but in this table values of all other attribute are also stored such as fname,lname etc. So the attribute_id with value 11 is DOB attribute.

mysql> desc customer_entity_datetime;
+----------------+----------------------+------+-----+---------------------+----------------+
| Field          | Type                 | Null | Key | Default             | Extra          |
+----------------+----------------------+------+-----+---------------------+----------------+
| value_id       | int(11)              | NO   | PRI | NULL                | auto_increment | 
| entity_type_id | smallint(8) unsigned | NO   | MUL | 0                   |                | 
| attribute_id   | smallint(5) unsigned | NO   | MUL | 0                   |                | 
| entity_id      | int(10) unsigned     | NO   | MUL | 0                   |                | 
| value          | datetime             | NO   |     | 0000-00-00 00:00:00 |                | 
+----------------+----------------------+------+-----+---------------------+----------------+
5 rows in set (0.01 sec)

Thanks.

  • 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-05-18T20:06:11+00:00Added an answer on May 18, 2026 at 8:06 pm

    Something like:

    SELECT value_id, value, DATE_SUB(value, INTERVAL 100 YEAR) as 'correct'
    FROM customer_entity_datetime
    WHERE value > NOW()

    should give you those rows. To update them, just apply:

    UPDATE customer_entity_datetime
    SET value = DATE_SUB(value, INTERVAL 100 YEAR)
    WHERE value > NOW()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any single msql query which can update customer DOB? I want to
Is there any query which can return me the number of revisions made to
Is there any single framework with which I can build a css3, html5 website
is there any way how in this situation insert and update DB with single
Is there a single preprocessor token that can be used to detect any iPhone
Is there any single software that can be used to test the website designed
Is there any way to have multiple distinct HTML pages contained within a single
This query not inserted when variable $subject has single quotes . Is there any
Is there any way I can validate a single attribute in ActiveRecord? Something like:
Is there any way can we add two datapools to a single script? Or

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.