Reputation: 65
How to solve the problems. I'm having a difficulty in using BETWEEN
operator in VIEW
.
My query not working fine
CREATE VIEW IT_SERVICE_VIEW
AS
SELECT `it_service_ticket`.ASSIGNEDTO
,`it_service_ticket`.status
,`it_service_ticket`.REQUEST_DATE
,`it_service_ticket`.XETR
,`it_service_ticket`.FEEDBACK_RATE
,`it_problem`.etr
,`city_master`.city_name
FROM `it_service_ticket`
INNER JOIN `it_problem`
ON `it_service_ticket`.`it_problem_id`=`it_problem`.`it_problem_id`
INNER JOIN `city_master`
ON `it_service_ticket`.cityid=`city_master`.city_id
WHERE `xetr` BETWEEN '1/1/2017 12:00:00 AM' AND '3/3/2017 12:00:00 PM';
Upvotes: 0
Views: 43
Reputation: 522762
The date formats in your BETWEEN
clause are wrong. They should be in a standard format, something like this:
BETWEEN '2017-01-01 00:00:00' AND '2017-03-03 12:00:00'
As it stands now, your query/view would be comparing the xetr
column against those timestamps being treated as text, which is not what you want.
Upvotes: 1