Link to home
Start Free TrialLog in
Avatar of pmessana
pmessana

asked on

Comparing dates in MYSQL is not working after MYSQL upgrade

I have a query that has run for multiple years, we recently upgraded (5.0.45).  It appears that comparing using the Date() function no longer is working correctly.

Attaching the query below, the ship_dt column is a timestamp column and we are only wanting to compare the date and not the entire timestamp.

As mentioned this worked perfectly fine under 4.x

Any help would be greatly appreciated.
SELECT DISTINCT a.orderid FROM orders a WHERE a.orderstatus=2 AND DATE(a.ship_dt)='2008-06-26'

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CoyotesIT
CoyotesIT

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pmessana
pmessana

ASKER

Although I wish that I could understand why this suddenly stopped working your solution did work.
I'm glad it worked for you, MySQL 5 is just more standardized. What's with the grade?

CoyotesIT