Hello People
I need to know if is possible to count Debits or Credits Amounts for example:
IIF([field] = debits then 1 else 0
or
IIF([field] = Credits the 1 else 0
To count the portion in debits or Credits.
I need to type this IIF in a query to determine de calculation but i dont know how is the correct formatt for this..
Thanks every one
8 2327
As taken from the MSDN:
Visual Basic for Applications Reference
IIf Function
Returns one of two parts, depending on the evaluation of an expression.
Syntax
IIf(expr, truepart, falsepart)
The IIf function syntax has these named arguments:
Part Description
expr Required. Expression you want to evaluate.
truepart Required. Value or expression returned if expr is True.
falsepart Required. Value or expression returned if expr is False.
So you would be looking at something like: -
IIF([field] = "credit",1,0)
-
Hope this helps.
- Minion -
Hello...
If you need to count the amount of Credits and Debits you have you would add these fields in your query:
CountCredits:iif([Credits]="Credit", 1, 0)
CountDebits:iif([Debits]="Debit", 1, 0)
This will number the accounts that you have that say "Credit" in the Credits field with a 1 and "Debit" in the Debits field with a 1. This is a great tool for when you are creating a pivot report in excel so that it will give you the total count of Credit and Debit accounts. I would syggest making 2 fields, 1 for Credits and 1 for Debits instead of combining them.
From your question, this is what I assumed you were asking, although, I was confused whether or not you wanted the amounts captured.
Thanks, but the field have amounts. If the amount is in black color like debits then count 1 else 0. Otherwise if is in red like credits count 1 else 0. I only one field for amounts the formatt I used to determine credit o debits in the text box report is $#,##0.00[Black];($#,##0.00)[Red];\0;
Hello...
If you need to count the amount of Credits and Debits you have you would add these fields in your query:
CountCredits:iif([Credits]="Credit", 1, 0)
CountDebits:iif([Debits]="Debit", 1, 0)
This will number the accounts that you have that say "Credit" in the Credits field with a 1 and "Debit" in the Debits field with a 1. This is a great tool for when you are creating a pivot report in excel so that it will give you the total count of Credit and Debit accounts. I would syggest making 2 fields, 1 for Credits and 1 for Debits instead of combining them.
From your question, this is what I assumed you were asking, although, I was confused whether or not you wanted the amounts captured.
You can not determine debits/credits in a query based on colors. You would have to have another field in your table to display whether or not they are credit or debit or you can use specific amounts to interpret this.
NeoPa 32,556
Expert Mod 16PB
What do you use to determine whether the record is a Credit or a Debit?
Do you really want a count? Or are you actually looking for a Sum of the values?
What do you use to determine whether the record is a Credit or a Debit?
Do you really want a count? Or are you actually looking for a Sum of the values?
Thanks Neo
- I determine credits and debits with this formatt $#,##0.00[Black];($#,##0.00)[Red];\0;
- Yes I want to count.
NeoPa 32,556
Expert Mod 16PB
...
- I determine credits and debits with this formatt $#,##0.00[Black];($#,##0.00)[Red];\0;
...
You mean negative numbers are credits and postive ones are debits yes?
...
- Yes I want to count.
OK
I will see if I can get another look at this later. Running late and have a home to go to ;)
NeoPa 32,556
Expert Mod 16PB
It seems that while I may have a home to go to, I have no viable means of transport just for now (motorbike broken down) so I'll have another look at this now.
Assuming a table ([Table]) and a field ([Field]) in that table, then you want some SQL like : - SELECT Count(IIf([Field]<0,Null,[Field])) AS NumDebits,
-
Count(IIf([Field]<0,[Field],Null)) AS NumCredits
-
FROM [Table]
This is very basic and counts across the whole table. If you need your counts to be done by particular grouping, then we need to know that before we can help further.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jose Benito Gonzalez Lopez |
last post by:
Hi there,
Does anyone know how I could do in order
to get/count the number of pages of a PDF file? (from
python of course ;) )
Thanks beforehand.
Cheers,
Jose
|
by: Sridhar R |
last post by:
>From technical point of view, I could not understand the the reasoning
behind using Java in major companies. Sure that Python, is used in
some, but still Java is considered as a sure-job...
|
by: jeff brubaker |
last post by:
Hello,
Currently we have a database, and it is our desire for it to be able
to store millions of records. The data in the table can be divided up
by client, and it stores nothing but about 7...
|
by: Kevin |
last post by:
Group By - Client
Sum - PastDue: Iif(DateDiff("d",,Date())>30,,0)
Sum - Current: Iif(DateDiff("d",,Date())<31,,0)
These 2 sum fields work fine, EXCEPT it is not summing my negative...
|
by: keith |
last post by:
I am trying to get a exact count of different distinct entries in an
Access column. At first, I was trying to work with three columns, but
I've narrowed it down to one to simplify it. I've searched...
|
by: ret4rt |
last post by:
Hello.
I have a database with movies similar with imdb and i want to find out which directors have directed both thriller and drama movies.
The output i want is like this "DIR_NAME,amount of...
|
by: =?Utf-8?B?TW9iaWxlTWFu?= |
last post by:
Hello everyone:
I am looking for everyone's thoughts on moving large amounts (actually, not
very large, but large enough that I'm throwing exceptions using the default
configurations).
We're...
|
by: whitsey |
last post by:
Here is what I have:
SELECT
(SELECT
COUNT(*) AS SEARCHES
FROM
SEARCHES
INNER JOIN GROUPS ON
SEARCHES.SITE_ID = GROUPS.SITE_ID
WHERE
|
by: subramanian100in |
last post by:
Below is my understanding about count algorithms.
Return type of count and count_if algorithms is
iterator_traits<InputIterator>::difference_type.
If the container contains more than...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
|
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...
|
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...
| |