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 / April 2008

Tip: Looking for answers? Try searching our database.

need help with expression

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
erick-flores - 23 Apr 2008 18:44 GMT
I have the following expression in a query:

       Actual Month: Sum(IIf(Len([header]=3),[qty]))

basically I want a sum of quantity if the length of header = 3.

But when I try to run the query, i get :

"This expression is typed incorrectly, or it is too complex to be
evaluated...."

Any ideas?
KARL DEWEY - 23 Apr 2008 19:06 GMT
Do you actually have a field named 'header'?
What kind of data do you store there?
Signature

KARL DEWEY
Build a little - Test a little

> I have the following expression in a query:
>
[quoted text clipped - 8 lines]
>
> Any ideas?
Jerry Whittle - 23 Apr 2008 19:38 GMT
IIf requires three parts: The expression, true part, false part. I don't see
the false part in yours.
Signature

Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

> I have the following expression in a query:
>
[quoted text clipped - 8 lines]
>
> Any ideas?
John Spencer - 23 Apr 2008 19:48 GMT
Misplaced parentheses could be the problem. And I would also include a value
for the False result.

Actual Month: Sum(IIf(Len([header])=3,[qty],Null))

I don't think there will be any problem is Header contains null.

You could also write this as

Actual Month: Sum(IIf([header] Like "???",[qty],Null))

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

> I have the following expression in a query:
>
[quoted text clipped - 8 lines]
>
> Any ideas?
erick-flores - 24 Apr 2008 20:59 GMT
Thanks for the replies. I ended up using another field in the IF
statement so I dont need to calculate the length of anything.
 
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



©2009 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.