I have a database with a table, jobs and i have written this query to get information from this table. But i am getting no results with this data and i have no idea why?

SELECT startDateTime, endDateTime FROM jobs WHERE startDateTime BETWEEN '19/11/2013' AND '20/11/2013'

Database Structure:

1 jobId int(11)
2 customerId int(11)
3 addressId int(11)
4 description text
5 startDateTime datetime
6 endDateTime datetime

Data:

1 | 1 | 1 | Light fitting | 2013-11-19 14:00:00 | 2013-11-19 16:00:0

Recommended Answers

Try using Y-M-D format, see if that works?

SELECT startDateTime, endDateTime FROM jobs WHERE startDateTime BETWEEN '2013-11-19' AND '2013-11-20'
Jump to Post

All 2 Replies

Try using Y-M-D format, see if that works?

SELECT startDateTime, endDateTime FROM jobs WHERE startDateTime BETWEEN '2013-11-19' AND '2013-11-20'

Thanks worked great!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.