Please help.
GOAL: I hope to calculate a total amount in a TotalQuery (or field in
the SubQuery?), based upon three field amounts in a SubQuery.
STATUS: When I create an expression in the TotalQuery based upon
SubQuery fields, e.g:
Total: [SOPAmount] + [PetFilingAmount] + [SummonsFilingAm ount]
'The resulting [Total] field displays each of the three SubQuery
amounts sequentially in the same field [156.00 50.00 5.00], rather than
the sum of having added them. However, when I test the expression
using multiplication (*) the [Total] field displays the correct total
amount. For example, the expression:
Total: ([SOPAmount]*[PetFilingAmount])+ [SummonsFilingAm ount]
'yields a correct single total amount, [7505.00].
The SubQuery in ms-access 2k sums the amounts from certain checks
entered for specific purposes. All resulting records from the Subquery
are sorted on a [MergeDate] field:
The Subquery SQL statement is as follows:
SELECT FormatCurrency( DSum("[Amount]","tblPaymentAc counting","[Purpose]
= 'Service of Process' "),2) AS SOPAmount,
FormatCurrency( DSum("[Amount]","tblPaymentAc counting","[Purpose] =
'Petition Filing Fees' "),2) AS PetFilingAmount ,
FormatCurrency( DSum("[Amount]","tblPaymentAc counting","[Purpose] =
'Summons Filing Fees' "),2) AS SummonsFilingAm ount
FROM tblDebtorMaster FileList
WHERE (((tblDebtorMas terFileList.Mer geDate)=#1/14/2005#));
I don't work with Access all the time, so I am not that astute at these
queries. Could someone please advise me on the best method to obtain a
TotalFees based upon the added total from the three field amounts in
the underlying query. 2 5646
I suspect your problem may be that the FormatCurrency has turned the fields into a text field by default, so that the + operator acts as a concantenation rather than an addition. In your total query, try explcitly converting them back into a number eg:
TotalFees: CDbl([SOPAmount]) + Cdbl([PetFilingAmount]) + CDbl([SummonsFilingAm ount])
(I think it's CDbl - it's whatever the equivalent of CInt and CStr are... CSng may be enough too).
--
Message posted via http://www.accessmonster.com
David Seeto via AccessMonster.c om wrote: I suspect your problem may be that the FormatCurrency has turned the
fields into a text field by default, so that the + operator acts as a
concantenation rather than an addition. In your total query, try
explcitly converting them back into a number eg: TotalFees: CDbl([SOPAmount]) + Cdbl([PetFilingAmount]) +
CDbl([SummonsFilingAm ount]) (I think it's CDbl - it's whatever the equivalent of CInt and CStr
are... CSng may be enough too). -- Message posted via http://www.accessmonster.com
Yes, you were correct about the FormatCurrency conversion being the
problem. Your suggestion fixed the problem, and I appreciate your
response. Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: eric |
last post by:
Hi,everyone:
I have my xml data defined as
xml data definition I:
<?xml version="1.0"?>
<parents>
<parent>
<id>1000</id>
|
by: rick |
last post by:
Can anyone help, I am try to create a simple form using a table, where a
user can fill out
quanty and price and have a total automatically calculated and inserted in
another field.
I stuck trying to figure out how expand this script to recalculate when rows
are added or
removed.
My code so far.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
by: aspbeg |
last post by:
subtotal and total in a datagrid for any columns
|
by: mesud |
last post by:
helow i'm new but i wanna ask that i need the code to connect database access with vb and calculate total,subtotal,tax etc. and display it
|
by: bobw2961 |
last post by:
I have what I hope is a simple question for some of you. I have two
fields. Quantity and Price. I enter a text box named SubTotal in the
detail of the report and set the control source to
=*. This works fine and I have all the correct
values in the detail of the report. Now at the bottom of my report I
want a total. I insert a text box in the report footer named Total
and set the control source to =sum(). This does not work.
I get...
| |
by: mebrabham |
last post by:
Hello,
I am trying to create a running subtotal in a query and then graph the
running subtotal for each city group. The data looks like this in the
table (for illustration):
My City My Date Cumulative Sum Daily Sum
DC 03-Apr-07 6 6
DC 04-Apr-07 20 14
DC 05-Apr-07 0 0
DC 06-Apr-07 24 4
|
by: lee123 |
last post by:
hey all, i have made a order form with all the works. in vb 6 and in this form i have been trying to get a total of the items that a customer would have ordered. to make things make sense i have in my order form ( qty, product,unit price, and a total) there are 12 rows of these text boxes (1-44) i believe, any way on the bottom of the order form there is a (subtotal,salestax,final total.) now the question is.....(and it probably a simple one i...
|
by: KUTTAN |
last post by:
i want to total of all 7th columns(in all rows) of my table
my tables id is ctl00_ContentPlaceHolder1_Quote1_RadGdProductList_ctl01
The first row of the table is headings
the following code works fine in IE7
But I am getting 'NaN' when i use Mozilla
i found that
|
by: murch.alexander |
last post by:
Hi all,
I have a query that uses a subquery to subtotal one of its fields.
This part is working fine. The twist is that when I encounter certain
values, I want to reset the subtotal to zero and continue on. So, it's
possible that out of 100 records, I might reset the subtotal to zero
20 times.
I can do this in a report but I need it in query form so I can run it
automatically when users log in to let them know if the subtotal has
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |