"Kent Roberts" <[EMAIL PROTECTED]> wrote on 08/09/2005 10:42:24 AM:
> I have a simple SP that is selecting rows based on a date range > using parameters. I've tried several permutations that all return 0 rows. > > The select statement looks like this: > > select * from 'mit_log'.'mitlog' where StartDateTime between > '2005-04-01' and '2005-04-07' > > and returns over 300,000 rows. The SP looks like this: > > ----------------------------------------------------------------------------------------------------------------- > DELIMITER $$ > > DROP PROCEDURE IF EXISTS `mit_logs`.`spPatientsLikeUsersByDate`$$ > > Create procedure `mit_logs`.`spUsingDateRange`(begDate datetime, > endDate datetime) > BEGIN > SELECT * > FROM mitlog > WHERE (mitlog.StartDateTime between @begDate And @endDate); > END$$ > ----------------------------------------------------------------------------------------------------------------- > > and compiles ok. The calling statement looks like this: > > call spPatientsLikeUsersByDate ('2005-04-01','2005-04-07') > > Like I said, I've tried several guesses at syntax with no luck. When > I take out the parameters and hard code the dates, it works. > > Any ideas? > > Thanks in advance, > Kent in Montana > > Could it be that you are calling one procedure (spPatientsLikeUsersByDate) but making all of your changes in another (spUsingDateRange)? What if you tried calling `spUsingDateRange` instead? Shawn Green Database Administrator Unimin Corporation - Spruce Pine