Avatar of dolan2go
dolan2goFlag for United States of America

asked on 

Between MySQL datetime values?

runTime  is datetime type.

SELECT * FROM User WHERE runTime BETWEEN 2011-05-16 03:01:00 AND 2011-05-16 03:01:00

Open in new window


Results in:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '02:59:00 AND 2011-05-16 03:01:00' at line 1

SELECT * FROM User WHERE runTime BETWEEN '2011-05-16 03:01:00' AND '2011-05-16 03:01:00'

Open in new window


Results in:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
MySQL Server

Avatar of undefined
Last Comment
dolan2go
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of dolan2go
dolan2go
Flag of United States of America image

ASKER

Wow. That was easy for you.

Solution:
Cut n paste is not always a time saver.
Avatar of dolan2go
dolan2go
Flag of United States of America image

ASKER

A great answer to get right to the point.
Thanks.
MySQL Server
MySQL Server

MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.

49K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo