### when program starts
$MinsUsedInRangeQuery1
= $DBH->prepare('DECLARE @StartRange datetime, @EndRange datetime'
. ' SET @StartRange = ?, @EndRange = ?'
. ' SELECT SUM(DATEDIFF(mi,StartTime,EndTime))'
. ' AS MinsUsed FROM Sessions'
. ' WHERE AuthSource = ? AND UserID = ?'
. ' AND StartTime BETWEEN @StartRange AND @EndRange'
. ' AND EndTime BETWEEN @StartRange AND @EndRange')
|| die 'Unable to prepare MinsUsedInRange query 1';
I think the problem is in your SET @localvariable syntax. I believe when
declaring and setting two variables you have to use SET explicitly for each
variable unlike the DECLARE statement where you can comma seperate them so:
' SET @StartRange = ?, @EndRange = ?'
should be:
' SET @StartRange = ? SET @EndRange = ?'
Hope this helps.
--Trevor Joerges.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs