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 |
|
WoodHouse
Posting Yak Master
211 Posts |
Posted - 2010-04-13 : 05:32:50
|
| Please help on this..I have a problem to be solvedI have a view defined over a table as Create View vTestAS Select * from TblName The table has LastUpdated Column of Type Datetime.I have a variable like @LastRunDate DatetimeI run a query like Select * from vTest where LastUpdated >=@LastRunDateI get a error converting into DatetimeHowever select * from tblName where LastUpdated >=@LastRunDate runs successfully returning the rows that satisfy this condition.what could be the cause |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-13 : 05:43:49
|
Maybe your view isn't simple like this example?Maybe in this view the date is already converted / concatenated or whatever? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-13 : 06:54:07
|
| how are you passing value for @LastRunDate?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-13 : 07:10:44
|
quote: Originally posted by visakh16 how are you passing value for @LastRunDate?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
That shouldn't be the problem I think, because the var is of type datetime and the query without using the view is running. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|