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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:50:37+00:00 2026-05-17T14:50:37+00:00

I have a table with * PwdSettings that has a value of -50 (which

  • 0

I have a table with

*PwdSettings that has a value of -50 (which is say 50 days)

*PwdDate (which is the date last updated)

*ExpDate (which is 0 or 1, if Password is old i need it set to 1)

I’m trying to write a query to say “IF PwdDate is < PwdSettings Then SET ExpDate = 1”

Here is what I have tried so far, everything throws an error.

UPDATE wp_users SET ExpDate = 1 WHEN PwdDate < DATE_ADD(CURDATE(), INTERVAL -50 DAY) WHERE user_email='dylan@wccit.com'

UPDATE wp_users SET ExpDate = 1 WHERE user_email='dylan@wccit.com' IF(PwdDate < DATE_ADD(CURDATE(), INTERVAL -50 DAY))

IF PwdDate < DATE_ADD(CURDATE(), INTERVAL -50 DAY) WHERE user_email='dylan@wccit.com' THEN SET ExpDate = 1
  • 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-17T14:50:37+00:00Added an answer on May 17, 2026 at 2:50 pm

    Use:

    UPDATE wp_users 
       SET ExpDate = 1 
     WHERE PwdDate < DATE_ADD(CURDATE(), INTERVAL -50 DAY) 
    

    …or, using DATE_SUB:

    UPDATE wp_users 
       SET ExpDate = 1 
     WHERE PwdDate < DATE_SUB(CURDATE(), INTERVAL 50 DAY) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table in my database which has fields of ID,NAME,CONTEXT. I am showing
I have table named as contacts which has nearly 1.2 million records we use
I have table in an MS Access database that looks like this: ID Symbol
I have table the following data structure in SQL Server: ID Date Allocation 1,
I have table view which is populated from an array grabbed from a url.
I have table of data that I am attempting to use lattice in R
I have table X, and each record in X has many records in Y.
I have table with product_category and its has more than 20 categories and I
I have table: STATUS DEFECT DATE CLOSED IP 01.01.2012 CLOSED TV 03.03.2012 CLOSED ADSL
I have table view controller with me. What I want is that I want

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.