RE: functions in AS

2006-06-08 Thread Jay Blanchard
[snip] SET @sql=CONCAT('SELECT SUM(IF(SUBSTRING(updated,1,10)=CURDATE(), 1, 0)) AS ',     char(39),     CURDATE(),     CHAR(39),     ' FROM tablename GROUP BY group by psDealer' ); PREPARE stmt FROM @sql; [/snip] Very clever Peter! Thanks for your he

Re: functions in AS

2006-06-07 Thread Peter Brawley
Jay, [snip] We all know that you cannot do something like this; sum(if(substring(updated, 1, 10) = curdate(), 1, 0)) AS curdate() nor can you use user variables even though they get set properly set @d1 = curdate(); sum(if(substring(updated, 1, 10) = curdate(), 1, 0)) AS @d1 So, do

RE: functions in AS

2006-06-07 Thread Jay Blanchard
[snip] >We all know that you cannot do something like this; >sum(if(substring(updated, 1, 10) = curdate(), 1, 0)) AS curdate() >nor can you use user variables even though they get set properly >set @d1 = curdate(); >sum(if(substring(updated, 1, 10) = curdate(), 1, 0)) AS @d1 >So, does anyone know o

Re: functions in AS

2006-06-07 Thread Peter Brawley
Jay, We all know that you cannot do something like this; sum(if(substring(updated, 1, 10) = curdate(), 1, 0)) AS curdate() nor can you use user variables even though they get set properly set @d1 = curdate(); sum(if(substring(updated, 1, 10) = curdate(), 1, 0)) AS @d1 So, does anyone know of a w