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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:08:53+00:00 2026-05-29T07:08:53+00:00

Column d is DATE, column t is time, column v is, for example, INT.

  • 0

Column d is DATE, column t is time, column v is, for example, INT. Let’s say I need all the values recorded after 15:00 of 01 Feb 2012 and on. If I write

SELECT * FROM `mytable` WHERE `d` > '2012-02-01' AND `t` > '15:00'

all the records made before 15:00 at any date are going to be excluded from the result set (as well as all made at 2012-02-01) while I want to see them. It seems it would be easy if there were a single DATETIME column, but there are separate columns for date and time instead in the case of mine.

The best I can see now is something like

SELECT * FROM `mytable` WHERE `d` >= '2012-02-02' OR (`d` = '2012-02-01' AND `t` > '15:00')

Any better ideas? Maybe there is a function for this in MySQL? Isn’t there something like

SELECT * FROM `mytable` WHERE DateTime(`d`, `t`) > '2012-02-01 15:00'

possible?

  • 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-29T07:08:54+00:00Added an answer on May 29, 2026 at 7:08 am

    You can use the mysql CONCAT() function to add the two columns together into one, and then compare them like this:

    SELECT * FROM `mytable` WHERE CONCAT(`d`,' ',`t`) > '2012-02-01 15:00'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In SQL Server I have a DATETIME column which includes a time element. Example:
I have a date and time column in my mysql table called start_date and
How do you insert data into a MySQL date or time column using PHP
I've an excel spreadsheet with a column which has the date and time of
What is the best way to randomize the time part for a DATE column,
In my table I have DateTime , Hour column. example : 2012-05-14 00:00:00.000 and
let's say my table schema is like bellow (it's only a simplified example): MyTable
I am trying to set my columns default date time to system datetime. It
Suppose I have a datetime column in MySQL. How do I select all that
I have a MySQL table with the following columns: id(int), date (timestamp), starttime(varchar), endtime(varchar),

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.