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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:45:10+00:00 2026-05-16T11:45:10+00:00

I have table like this create table tbl_1( year int, month int, day int

  • 0

I have table like this

create table tbl_1(
  year int,
  month int, 
 day int
)

insert into tbl_1 values(2009,  11, 30)
insert into tbl_1 values(2010,   3,  4)
insert into tbl_1 values(2011,   5, 13)
insert into tbl_1 values(20011, 12, 24)

I want to delete date from 2009-11-30 until 2011-5-13, but I can’t because all of columns are int and I can’t use this query :

delete from tbl_1 
 where year >=2009 
   and year<=2011 
   and month >=11 
   and month <=5 
   and day >=30 
   and day <=13

..because: 1 < month < 12 and 1 < day < 30

I know that this is terrible mistake.

I have many table that use this way for save date , please help me I don’t have time to delete and recreate all of them.

  • 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-16T11:45:10+00:00Added an answer on May 16, 2026 at 11:45 am

    You could do it like this:

    DELETE FROM tbl_1 
    WHERE (year * 10000 + month * 100 + day) BETWEEN 20091130 AND 20110513
    

    I haven’t tested this. I would recommend testing it first on a test system before running it on your production data so that you don’t accidentally delete the wrong data.

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

Sidebar

Related Questions

I have a User table defined like this: CREATE TABLE Users( UserId int IDENTITY(1,1)
I have a table like this one CREATE TABLE MyTable ( [MyTableID] [int] NOT
I have a MySQL table like this: CREATE TABLE categories ( ID INT NOT
If I have a table like this: CREATE TABLE sizes ( name ENUM('small', 'medium',
I have a SQL Server 2005 table like this: create table Taxonomy( CategoryId integer
I have a table in PostgreSQL where the schema looks like this: CREATE TABLE
I have a list of values I want to insert into a table via
i have a table like this : CREATE TABLE [Mytable]( [Name] [varchar](10), [number] [nvarchar](100)
I have a MySQL table like this CREATE TABLE IF NOT EXISTS `vals` (
Ok, I have one JavaScript that creates rows in a table like this: function

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.