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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:36:55+00:00 2026-06-18T03:36:55+00:00

I want to create an Event for Table :- ACCOUNTS(id char(5),balance decimal(10,2), date_created date)

  • 0

I want to create an Event for Table :-

ACCOUNTS(id char(5),balance decimal(10,2), date_created date)

Value for the DATE_CREATED column will always be = NOW(), i.e. the date when the row was inserted in the table

I want that the balance for each row gets increased by 2% after every 31 Days, according to its DATE_CREATED column, i.e. after (DATE_CREATED+31 Days) for each row.

I wanted to know whether it is possible or not and if it is possible then what would be the code for it?

  • 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-18T03:36:55+00:00Added an answer on June 18, 2026 at 3:36 am

    You’ll need to write an UPDATE statement that uses DATEDIFF and MOD

    Try something like:

    UPDATE Accounts 
    SET Balance = Balance * 1.02 
    WHERE DATEDIFF(now(),date_created) MOD 31 = 0;
    

    And here is the SQL Fiddle.

    You can schedule this to run daily. That’s probably your best approach.

    Good luck.

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

Sidebar

Related Questions

Good morning all, i want to create an event in MySQL that will UPDATE
I want to create an Event Calendar for my iPhone App. In a first
I want to create an event content type with one field Dates contains a
IN VB.NET (not c#)... I want to create an event than can be canceled
I want to create my own event - OnPositionChange . Event implementation of course
I'm making an online calendar. One will be able to create en event and
Is there any event in table view which will get triggered when i try
I have three tables: CREATE TABLE person (id int, name char(50)) CREATE TABLE eventtype
I have two tables, round and event. One round has many events. create table
Here is my table structure and data: CREATE TABLE event ( EventID INT(11) NOT

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.