Sub-Totals in report(Data type mismatch)

  • Thread starter Regan via AccessMonster.com
  • Start date
R

Regan via AccessMonster.com

Hi i'm trying to figure out how to put sub totals in my report, it doesn't
seem to be working

i seem to be able to do it for hours, but i can't sub-total the sub total
field.

Example of Report


FILE NUM 12342

Bob Jones
Peanut Catagory

EntryDate Details Hours
ChargeRate subtotal
01/01/2007 this is what i did today 2.2
$35 $77
02/01/2007 I didn't do this but i enter 10
$60 $600

subtotal *$677
Cashew Nut Catagory
etc etc

What i want to do is sub total the sub total So it shows where the * is

i can sum the hours =sum(hours)
But the same thing with subtotal =sum(subtotal) doesn't seem to work?!
(data type mismatch)

Here is the SQL behind the report.

SELECT tblFiles.FileID, tblFiles.FileNum, tblTimesheet.EntryDate, tblcontacts.
firstname & " " & tblcontacts.lastname AS Fullname, tblTimesheet.Details,
tblCodes.InvCatagory, tbltimesheet.units/10 AS Hours, IIf(tblcodes.
chargetype="code",tblcodes.chargerate,tblemployconf.chargeoutrate) AS
ChargeRate, Ccur(Format(tbltimesheet.units/10*IIf(tblcodes.chargetype="code",
tblcodes.chargerate,tblemployconf.chargeoutrate),'Currency')) AS SubTotal
FROM tblFiles INNER JOIN (tblContacts INNER JOIN (tblCodes INNER JOIN
(tblEmployees INNER JOIN (tblEmployConf INNER JOIN tblTimesheet ON
(tblEmployConf.EmployConfID = tblTimesheet.EmployconfID) AND (tblEmployConf.
EmployeeID = tblTimesheet.EmployeeID)) ON (tblEmployees.EmployeeID =
tblTimesheet.EmployeeID) AND (tblEmployees.EmployeeID = tblEmployConf.
EmployeeID)) ON tblCodes.CodeID = tblTimesheet.CodeID) ON tblContacts.
ContactID = tblEmployees.ContactID) ON tblFiles.FileID = tblTimesheet.FileID
WHERE not tblcodes.invCatagory <> Null or tblcodes.invcatagory <> "";

Any help would be great

Thanks in advance

--
Regan,
Paeroa
World famous in New Zealand

Message posted via AccessMonster.com
 
G

Guest

I would get rid of the formatting performed in the query and use:
tbltimesheet.units/10*Val(IIf(tblcodes.chargetype="code",
tblcodes.chargerate, tblemployconf.chargeoutrate)) AS SubTotal
 
R

Regan via AccessMonster.com

Thanks Duane, did what i needed

Usually would have tried to figure it out myself , reading previous posts,
trial and error. But i was too lazy yesterday, got a blinking headcold and
can't seem to hold a thought in my head.

Thanks again for you help

Duane said:
I would get rid of the formatting performed in the query and use:
tbltimesheet.units/10*Val(IIf(tblcodes.chargetype="code",
tblcodes.chargerate, tblemployconf.chargeoutrate)) AS SubTotal
Hi i'm trying to figure out how to put sub totals in my report, it doesn't
seem to be working
[quoted text clipped - 46 lines]
Thanks in advance

--
Regan,
Paeroa
World famous in New Zealand

Message posted via AccessMonster.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