Simple as it might seem this has defeated me so far.
I want to enter sequential dates for say 1 year in a table by means of a stored program.
I can attach one of my many effoorts if it helps.
Using a date type it stope at the end of the current month.
[code=mysql]
DROP PROCEDURE `adddates`//
CREATE DEFINER=`root`@ `localhost` PROCEDURE `adddates`()
begin
declare len int;
declare dd datetime;
declare aday int;
set aday = 24*3600;
set len = 100;
set dd = now();
while len > 0 do
insert into counter2(thedat e) values (date(dd));
set dd = dd + aday;
set len = len-1;
end while;
end
[/code]
Any helpful suggestions welcome
--
Dave B
I want to enter sequential dates for say 1 year in a table by means of a stored program.
I can attach one of my many effoorts if it helps.
Using a date type it stope at the end of the current month.
[code=mysql]
DROP PROCEDURE `adddates`//
CREATE DEFINER=`root`@ `localhost` PROCEDURE `adddates`()
begin
declare len int;
declare dd datetime;
declare aday int;
set aday = 24*3600;
set len = 100;
set dd = now();
while len > 0 do
insert into counter2(thedat e) values (date(dd));
set dd = dd + aday;
set len = len-1;
end while;
end
[/code]
Any helpful suggestions welcome
--
Dave B
Comment