Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Could someone enlighten me as to why this CAST function won't work in MySQL? Thank you in advance.
SELECT OrderNumber, OrderDate, ShipDate, CAST(ShipDate - OrderDate AS INTEGER) AS DaysElapsedFROM Orders
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-06-24 : 14:36:13
would be better off posting it in MySQL forum. This is MS SQL Server forum------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2012-06-26 : 05:33:12
Are you trying to find out day difference? Mysql doesnot support CASTing to integer. Use SignedSELECT OrderNumber, OrderDate, ShipDate, CAST(ShipDate - OrderDate AS SIGNED) AS DaysElapsedFROM OrdersMadhivananFailing to plan is Planning to fail