DSUM to pull data from Access DB

B

Brian

Howdy All,

I'm trying to sum data contained in an Access DB based on multiple criteria.

DB name = FTD.mdb
location = c:\FTD.mdb

I'm trying to sum Labor hours (which are in a column labels 'Labor) for a
specific 'Manager' (column name) and specific 'Assignee' (column name).

Criteria entered in A1:B2
A B
1 Manager Assignee
2 Flintsone, Fred Rubble, Barney

Formula I have tried =DSUM("C:\FTD.mdb","Labor",A1:B2)

I'm getting the generic "The formula you typed contains an error." and it
highlights my criteria range.

Have I overlooked something simple (which I usually do)?

Thanks,
Brian
 
P

ProfessionalExcel.com

Brian,

I hate to spoil your interpretation of the DSUM function, but the 'Database'
parameter doesn't refer to a separate Database file, it's a range of cells.
Please see below for the Excel Help description of the function:

DSUM(database,field,criteria)

'Database' is the range of cells that makes up the list or database. A
database is a list of related data in which rows of related information are
records, and columns of data are fields. The first row of the list contains
labels for each column.

'Field' indicates which column is used in the function. Enter the column
label enclosed between double quotation marks, such as "Age" or "Yield," or a
number (without quotation marks) that represents the position of the column
within the list: 1 for the first column, 2 for the second column, and so on.

'Criteria' is the range of cells that contains the conditions that you
specify. You can use any range for the criteria argument, as long as it
includes at least one column label and at least one cell below the column
label in which you specify a condition for the column.



In terms of solving your objective of getting data into Excel from Access;
If you want to automate it, you'll have to go down the VBA route; If you're
not worried about automation, then use Excel's wizard to import data from an
external source. The following article may be of use to you in terms of using
VBA: http://www.zmey.1977.ru/Access_To_Excel.htm


----------------------------
Please rate this post if it answers your question.

Thanks,

Chris
http://www.ProfessionalExcel.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top