Hit me baby one more time (MySQL Style)
So yesterday I blogged on how to create a T-SQL custom scalar function in SQL Server to clean up a DATETIME and output it like this... 05/11/2010 11:37 AM. So for anyone who is primarily using MySQL (most of our clients use SQL Server but we also take care of some MySQL driven CF apps too) here is the same code for creating and calling your very own inline function on the MySQL platform.
First you'll need to create the function as shown below...
1CREATE FUNCTION formatDateTime (dateTimeData DATETIME)
2RETURNS VARCHAR(30)
3BEGIN
4 DECLARE newDateTimeString VARCHAR(30);
5 SET newDateTimeString = DATE_FORMAT(dateTimeData, '%m/%d/%Y %h:%i %p');
6 RETURN newDateTimeString;
7END;
2RETURNS VARCHAR(30)
3BEGIN
4 DECLARE newDateTimeString VARCHAR(30);
5 SET newDateTimeString = DATE_FORMAT(dateTimeData, '%m/%d/%Y %h:%i %p');
6 RETURN newDateTimeString;
7END;
So now you can call this function like any other from within a statement, cfquery, stored procedure, etc. Here's an example MySQL call...
1SELECT NOW() AS CurrentDateTime,
2 formatDateTime(Now()) AS CurrentDateTimeDisplay
2 formatDateTime(Now()) AS CurrentDateTimeDisplay

http://www.prowantgo.net/
!!!!!www.efox-shop.com/" target="_blank">http://www.efox-shop.com/ !!!!!!!so cheap
` ?—? ? ??`_?
????????????? Sciphones i68, cect handy
?????????????ciphone c6, Ciphone?
?????????????Sciphones?, cect handys
??????????????hiphone , HIPHONE 4
?????????????pinphone 3gs, HIPHONE 4
??????????????
?——???????——?
??????????Grosshandel in http:/www.efox-shop.com/
?????????? ??????
????????????????
http://www.nfljerseysgo.com NFL Jerseys
http://www.eightshop.com polo shirts
http://www.onesunglasses.com oakley sunglasses
http://www.onesunglasses.com ray ban sunglasses
http://www.onesunglasses.com gucci sunglasses