Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

Syntax error in query expression

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Abel - 27 Jul 2006 15:23 GMT
Hi,
I'm new to MS Access and studies it through exploration and by reading Q&A's
from Microsoft.com.
I entered syntax query IIf([Field1]>1,(([Field1]+1)-[Field2])) in design
view of queries.This becomes Expr1: IIf([To]>1,(([Field1]+1)-[Field2])), when
I leave the cell. When I enter TableName on Table field and save query,
prompt "Syntax error (comma) in query expression
[TableName].[IIf([Field1]>1,(([Field1]+1)-[Field2]))]" appears. TableName is
same Table from which Field1 and Field 2 come from.
What did I do wrong here?
Also, How can I make the results of my queries appear on my desired fields?
Badly needing your help,
Abel
Jeff L - 27 Jul 2006 15:42 GMT
Take out the TableName from the Table field.  If you have more than one
table in your query that use the same field names, your syntax would be

IIf(TableName.[Field1]>1,((TableName.[Field1]+1)-TableName.[Field2]))

Also, the syntax for IIf is IIF(Condition, True, False).  There are no
optional parts to IIf, you need to have your statement do something
when your condition (Field1 > 1) is False.

Hope that helps!
Abel - 28 Jul 2006 15:16 GMT
Hi Jeff,
Thanks for making time. I did what you said but I can't say if it worked...
How can I make the result of my query appear on my desired field?

Thanks!

> Take out the TableName from the Table field.  If you have more than one
> table in your query that use the same field names, your syntax would be
[quoted text clipped - 6 lines]
>
> Hope that helps!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.