Solved

MySQL date between 2 dates but error msg 2011

Posted on 2011-09-12
1
313 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
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now