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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:35:36+00:00 2026-06-15T07:35:36+00:00

So apparently i’ve stumbled upon a coding error when trying to select the time

  • 0

So apparently i’ve stumbled upon a coding error when trying to select the time from my database.

SELECT * FROM `videos` WHERE `added_time` > AddTime( CurTime(), '14400 hour' )

is the code, i’m trying to select all the videos posted 10 days (14400 hours) ago using the “added_time” format, because it worked for my previous coding but in this one it work work.

Shown below is a link to the image showing how my database structure for videos are shown.

http://i.imm.io/NURT.png

Edit: Previously i had this problem for retrieving and deleting bulletins posted 10 days ago, and this code worked, however this code apparently won’t work when trying to retrieve the videos :/ I don’t know why, they’re using the same format.

See: http://i.imm.io/NUSW.png

  • 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-15T07:35:37+00:00Added an answer on June 15, 2026 at 7:35 am

    Get the actual date of added_time, then get the the date from 10 days prior to NOW().

    WHERE DATE(added_time) = DATE_SUB(NOW(),INTERVAL 10 DAY)

    You can change it to <= if you want to delete anything 10 days and greater.

    — Well now that we know one of them is a string and not a date field. Conver it.

    // Change %Y-%m-%d to your date 
    STR_TO_DATE(added_date, '%Y-%m-%d')
    

    After a little chat discussion and SQL Fiddlin’ I got the answer, and it works for him. Cheers.

    SELECT *
    FROM videos_shared
    WHERE DATE_FORMAT(STR_TO_DATE(added_date, '%a %b %d, %Y, %H:%i'), '%Y-%m-%d') 
    <= DATE_SUB(NOW(), INTERVAL 10 DAY)
    

    http://sqlfiddle.com/#!2/63eef/14

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

Sidebar

Related Questions

Apparently there is a database postgres that is created by default on each postgresql
Apparently there's a lot of variety in opinions out there, ranging from, " Never!
Apparently Matlab load loads the data from a .mat file into the variable that
Apparently this code does not work. The problem is described as: Parse error: syntax
Apparently I could not do the following: DECLARE @sql VARCHAR(2000) SET @sql = 'SELECT
Apparently oracle doesn't seem to distinguish between empty strings and nulls. E.g. Select name
Apparently, this code gives me error at the last line cvCvtColor(), what is wrong?
Apparently, I must run pytz.UTC.localize(datetime.datetime.now()) before I compare the current time with other naive
Apparently a JSON object can be passed inside a linked script. I'm trying to
Apparently if you run something like wth:alert('hi') from the console it just works, cross-browser.

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.