Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
select * from @t1 where maintdte != (select MAX(maintdte) from @t1)
How
select * from @t1 where maintdte != (select MAX(maintdte) from @t1) looks like in SQLCE
?
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2010-07-20 : 21:40:29
you need to try it in SQLCE and check the BOL for SQLCE. Not all syntax available in SQL Server is supported under SQLCE.KH[spoiler]Time is always against us[/spoiler]
Delinda
Constraint Violating Yak Guru
315 Posts
Posted - 2010-07-21 : 02:28:45
I was try as follow,
SELECT idx, Asset_idx, Details, MaintDte, Person_idx, HQRptNo, Commission_Flag, RE_SignOff_Flag, Created_By, Created_On, TagIdFROM nuRF_AssetMaintenanceRecordsWHERE (MaintDte <> (SELECT MAX(MaintDte) AS Expr1 FROM nuRF_AssetMaintenanceRecords AS t1))
Got an error as follow,There was an error parsing the query. [Token line number=1, Token line offcet=182, Token in error=SELECT]I'm really stuck
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2010-07-21 : 02:46:44
It could simply means that syntax is not supported in SQLCEDo it in 2 query1. get the max of MaintDte2. query where MaintDte <> result of (1)KH[spoiler]Time is always against us[/spoiler]
Delinda
Constraint Violating Yak Guru
315 Posts
Posted - 2010-07-21 : 04:48:46
can you post some sample?
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2010-07-21 : 05:11:06
[code]declare @max datetimeselect @max = max(..) from ...select .. . from ...where date = @max[/code]KH[spoiler]Time is always against us[/spoiler]
Delinda
Constraint Violating Yak Guru
315 Posts
Posted - 2010-07-21 : 06:37:05
The Declare SQL construct or statement is not supported.I hate this SQLServerCE
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2010-07-21 : 07:41:10
execute it as 2 separate statement. replace the declare will the your variable in your applicationKH[spoiler]Time is always against us[/spoiler]