Raymond D'Anjou
3/23/2007 2:43:00 PM
I'm tempted to say 'yes' but I wouldn't write code like this.
To make it clearer for anyone else looking at your statement.
I would prefer:
SET dbDate = (select MAX(@testDate) from Table1 where employeeID = 1)
SET is the prefered method for assigning values to variables.
"rodchar" <rodchar@discussions.microsoft.com> wrote in message
news:271C01E4-0274-48AF-BD62-014D33727611@microsoft.com...
> hey all,
> i have this query that goes a little some like this?
> select @testDate = dbDate
> from Table1
> where employeeID = 1
> order by dbDate DESC
> PRINT @testDate
>
> Results:
> 1,2/17/07
> 1,7/18/06
> 1,1/17/06
>
> Can i rest assure that @testDate is always going to be the last date in
> the
> resultset?
>
> thanks,
> rodchar