Avatar of Peter Chan
Peter Chan
Flag for Hong Kong

asked on 

Missing operator

Hi,
I get this error

Server Error in '/App18_devst' Application.

Syntax error (missing operator) in query expression 'iif(isnull([feat8_dt]),'',format([feat8_dt],'dd-mm-yyyy') [feat8_dt],[feat7],[feat9],[feat10],[obj4_fullname],[obj4_name],[feat11],[feat12],[feat13_dt] as [col_feat13_dt], [feat14_dt] as [col_feat14_dt] FROM [ite_tab] where [ite_abbr]=@par_id'.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

 Exception Details: System.Data.OleDb.OleDbException: Syntax error (missing operator) in query expression 'iif(isnull([feat8_dt]),'',format([feat8_dt],'dd-mm-yyyy') [feat8_dt],[feat7],[feat9],[feat10],[obj4_fullname],[obj4_name],[feat11],[feat12],[feat13_dt] as [col_feat13_dt], [feat14_dt] as [col_feat14_dt] FROM [ite_tab] where [ite_abbr]=@par_id'.

Source Error:


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:



[OleDbException (0x80040e14): Syntax error (missing operator) in query expression 'iif(isnull([feat8_dt]),'',format([feat8_dt],'dd-mm-yyyy') [feat8_dt],[feat7],[feat9],[feat10],[obj4_fullname],[obj4_name],[feat11],[feat12],[feat13_dt] as [col_feat13_dt], [feat14_dt] as [col_feat14_dt] FROM [ite_tab] where [ite_abbr]=@par_id'.]
   System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) +1844461
   System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +398
   System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +243
   System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +280
   System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +264
   App18._Default.refresh_pg() +4475
   App18._Default.Pfeat9_Load(Object sender, EventArgs e) +724
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Pfeat9.ProcessRequestMain(Boolean includeStfeat9sBeforeAsyncPoint, Boolean includeStfeat9sAfterAsyncPoint) +3178

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408  

due to this line. why?
                OleDbCommand cmd = new OleDbCommand("SELECT top 1 [ite_id],[ite_abbr],[ite_name],[ite_feat],[obj2_id],[obj3_id],[ent_id],[ent_feat2_id],[ent_title_id],[feat3],[feat4],[feat5],[feat6],[feat7],iif(isnull([feat8_dt]),'',format([feat8_dt],'dd-mm-yyyy') [feat8_dt],[feat7],[feat9],[feat10],[obj4_fullname],[obj4_name],[feat11],[feat12],[feat13_dt] as [col_feat13_dt], [feat14_dt] as [col_feat14_dt] FROM [ite_tab] where [ite_abbr]=@par_id and [ite_feat]=@par_feat", conn);

Open in new window

Microsoft AccessC#.NET Programming

Avatar of undefined
Last Comment
Peter Chan

8/22/2022 - Mon