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.

SQL Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gator - 18 Apr 2008 22:04 GMT
I have a form that displays in tabular form a table.  The form footer
contains a textbox that sums the 'amount' field.  I want to add another
textbox that displays the sum of the 'amount' of a query of records where
another field is queried.

For example.  =SUM(Amount) WHERE City LIKE 'B%'

I can't get this to work....is there something i'm doing wrong?

Many Thx
Signature

Gator

smk23 - 19 Apr 2008 17:11 GMT
THe problem may be use of SQL syntax within MSAccess. Access uses double
quotes " where SQL uses the single quote ' and the wildcard operator in
Access is * rather than %

HTH
Sam

> I have a form that displays in tabular form a table.  The form footer
> contains a textbox that sums the 'amount' field.  I want to add another
[quoted text clipped - 6 lines]
>
> Many Thx
John Spencer - 19 Apr 2008 20:37 GMT
If Amount is always positive the you could try this.

Abs(SUM(City Like 'B%' * Amount))

Otherwise

Sum(IIF(City like 'B%',Amount,Null))

If the like fails to work for you try changing the wild card character
to an asterisk "*".

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

> I have a form that displays in tabular form a table.  The form footer
> contains a textbox that sums the 'amount' field.  I want to add another
[quoted text clipped - 6 lines]
>
> Many Thx
 
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.