Solved

MySQL date between 2 dates but error msg 2011

Posted on 2011-09-12
1
319 Views
Last Modified: 2012-08-14
Here is the code that will Not run on MySQL on a Windows server:

SELECT CustomerYN, ActiveYN, FirstName, MidName, LastName, EmailMain, CoProfile, GoalUrgent, Mx1, Title, CoName, OrigContactDate
WHERE (OrigContactDate BETWEEN '2011-03-12' AND '2011-08-31')
FROM prospect
ORDER BY OrigContactDate, LastName

There seems to be a problem with the dates and the BETWEEN.  I find lots of examples but none that fixes this problem.  
0
Comment
Question by:KennethSumerford1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
KennethSumerford1 earned 0 total points
ID: 36526741
This works OK.

SELECT CustomerYN, ActiveYN, FirstName, MidName, LastName, EmailMain, CoProfile, GoalUrgent, Mx1, Title, CoName, OrigContactDate
FROM prospect
WHERE (
OrigContactDate
BETWEEN '2011-03-12'
AND '2011-09-10'
)
ORDER BY OrigContactDate, LastName
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Executing a script on a timer online 5 45
mysql qry 1 38
Building a glossary into your website 9 58
Error in sql query statment. 21 70
Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question