Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
zoe_mcai9mh3
Starting Member
2 Posts |
Posted - 2008-05-23 : 07:52:01
|
| whats wrong with this statment?declare @alpha as nvarchar(50)set @alpha = select top 1 monthyear from dbo.Performance_Indicators_Rolling order by recordkeyI get an errorIncorrect syntax near the keyword 'select'.Can anyone please help? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-23 : 07:53:56
|
quote: Originally posted by zoe_mcai9mh3 whats wrong with this statment?declare @alpha as nvarchar(50)set @alpha = (select top 1 monthyear from dbo.Performance_Indicators_Rolling order by recordkey)I get an errorIncorrect syntax near the keyword 'select'.Can anyone please help?
Put braces around select |
 |
|
|
zoe_mcai9mh3
Starting Member
2 Posts |
Posted - 2008-05-23 : 08:01:02
|
Thats it!Thanks |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-23 : 08:04:28
|
Or not use bracesselect top 1 @alpha = monthyear from dbo.Performance_Indicators_Rolling order by recordkey E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|