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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:19:36+00:00 2026-05-23T09:19:36+00:00

for a basic SQL command via PHPMyAdmin in MySQL I want to select items

  • 0

for a basic SQL command via PHPMyAdmin in MySQL I want to select items more than 1 day old. I’m getting a basic error saying that there’s a SQL syntax error, but can’t tell what I’m doing wrong here:

COMMAND:

select *
from table_name
where column_name < Date_Add(day, -1, GetDate())
and user_id = 1
and column_name <> '0000-00-00 00:00:00'

ERROR:

#1064 - You have an error in your SQL syntax; check the manual for the right syntax to use near '-1, GetDate()) and user_id = 1 and column_name &lt;&gt; '0000-00-00 00:00:00' LIMI' at line 3

Any clues? Thx!!

  • 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-23T09:19:37+00:00Added an answer on May 23, 2026 at 9:19 am

    I was thinking the syntax here is DATE_ADD.

    Ok here is from the 5.0 reference guide:

    The DATE_ADD() function and its
    synonym ADDDATE() allow you to add or
    subtract an interval to the selected
    date, date function or date constant.
    DATE_SUB() and SUBDATE() work in the
    same way but the interval specified is
    subtracted. (If the interval was
    negatvie DATE_SUB() makes it
    positive).

    mysql> SELECT NOW(), DATE_ADD(NOW(), INTERVAL 1 MONTH) \G
    *************************** 1. row ***************************
                                NOW(): 2008-09-25 11:43:29
    DATE_ADD(NOW(), INTERVAL 1 MONTH): 2008-10-25 11:43:29
    1 row in set (0.00 sec)
    

    Try using NOW() for the error.

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

Sidebar

Related Questions

This is a basic SQL datetime question, but I don't want to mess my
I don't mean Basic SQL, but strongly the specs and the difference between the
This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit
I have an SQL question which may be basic to some but is confusing
I'm running a pretty basic subquery on MySQL 4.0.30 . My goal is to
I've not used basic SQL commands for a while and I'm trying to pass
My need is fairly basic and I don't want to rebuild the wheel. I
I've got a basic php script that runs perfect in a browser. I want
this is a rather pathetic problem: In Visual Basic 2008 Express with SQL Server
We want to use Change Tracking to implement a two-way sync between a SQL

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.