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 |
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-06-30 : 14:35:35
|
| Declare @vSQL varchar(8000),@emp_count intset @vSQL = 'select top ' + convert(varchar,@emp_count) + ' * from emp_details where DateEntered < 6/30/2004 10:35:21 AM'Execute(@vSQL)this statment gives some error with the DateEnetered statement .if I remove the where clause it works |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-06-30 : 14:38:02
|
| some error? You probably need additional single quotes. Instead of EXEC(@vSQL):PRINT @SQLPost the output here.Tara |
 |
|
|
drymchaser
Aged Yak Warrior
552 Posts |
Posted - 2004-06-30 : 14:39:24
|
| set @vSQL = 'select top ' + convert(varchar,@emp_count) + ' * from emp_details where DateEntered < ' + '''' + '6/30/2004 10:35:21 AM' + '''' |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-06-30 : 14:40:26
|
| Ah, but now he doesn't learn why it was failing. Oh well.Tara |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-06-30 : 15:06:27
|
| working thanks.. |
 |
|
|
|
|
|