hi,
I have a report connected to a form where I can print the invoices between the two dates in the form but I have the problem:
when the checkbox = true refers to Canceled invoice but the values in this record still as it is, and I want to make the values equal zero if the checkbox = true, I tried hardly to make them equal zeros but the record disappeared from the report
I want to include the record within the report equal zero even it has a value in the query if the checkbox = true
I used this SQL Statement: - SELECT tbl_SalesInvoices.InvoiceNo, tbl_SalesInvoices.Customer_ID, tbl_SalesInvoices.Date, CCur(Sum(nz(tbl_SalesInvoicesDetails.UnitPrice,0)*(nz(tbl_SalesInvoicesDetails.Quantity,0)))) AS Extended, CCur(Sum((nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))*10/100)) AS [Tax 10%], CCur(Sum((((nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))+(nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))*10/100)))) AS [Grand Total], tbl_Customer.CompanyName, tbl_SalesInvoices.Cancelled
-
FROM (tbl_Customer INNER JOIN tbl_SalesInvoices ON tbl_Customer.CustomerID=tbl_SalesInvoices.Customer_ID) LEFT JOIN tbl_SalesInvoicesDetails ON tbl_SalesInvoices.InvoiceNo=tbl_SalesInvoicesDetails.InvoiceNo
-
GROUP BY tbl_SalesInvoices.InvoiceNo, tbl_SalesInvoices.Customer_ID, tbl_SalesInvoices.Date, tbl_Customer.CompanyName, tbl_SalesInvoices.Cancelled, tbl_Customer.CustomerID
-
HAVING (((tbl_SalesInvoices.Date) Between Forms![Search Sales Journal]!DF And Forms![Search Sales Journal]!DT) And ((CCur(Sum(nz(tbl_SalesInvoicesDetails.UnitPrice,0)*(nz(tbl_SalesInvoicesDetails.Quantity,0)))))=IIf(tbl_SalesInvoices.Cancelled=True,0,CCur(Sum(nz(tbl_SalesInvoicesDetails.UnitPrice,0)*(nz(tbl_SalesInvoicesDetails.Quantity,0)))))) And ((CCur(Sum((nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))*10/100)))=IIf(tbl_SalesInvoices.Cancelled=True,0,CCur(Sum((nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))*10/100)))) And ((CCur(Sum((((nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))+(nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))*10/100)))))=IIf(tbl_SalesInvoices.Cancelled=True,0,CCur(Sum((((nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))+(nz(tbl_SalesInvoicesDetails.UnitPrice,0)*nz(tbl_SalesInvoicesDetails.Quantity,0))*10/100)))))))
-
ORDER BY tbl_SalesInvoices.InvoiceNo;
thanks in advance for any help you may provide me
3 2656 nico5038 3,080
Recognized Expert Specialist
You'll need an IIF like: -
IIF(tbl_SalesInvoices.Cancelled=True,0,CCur(Sum(nz(tbl_SalesInvoicesDetails.UnitPrice,0)*(nz(tbl_SalesInvoicesDetails.Quantity,0))))) AS Extended, ....etc
-
Nic;o)
thank you
but this statement get the canceled record out of the report because when I check the checkbox in the form to cancel the invoice, I want to make it equal zeros in the report not to be disappeared
it is now 11 days looking for any solution for this problem
thank you
oh sorry
it is working like the charm this is the real best answer
I appreciate your replies
thank you very much
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mark Anderson |
last post by:
I'm getting a bit confused, it seems a checkbox object only has a length
value if there is more than one checkbox of that name, 2 checkboxes named
'box' have a length of 2 but a single box returns...
|
by: Piotr |
last post by:
how can I read (in alert for example) array index number of checked
checkbox?
I have:
<input type="checkbox" id="id_number" name="check" value="1"
onclick="show()"/>
<input type="checkbox"...
|
by: Megan |
last post by:
Hi everybody-
I'm trying to use a checkbox to control whether or not a date field in
a query "Is Null" or "Is Not Null."
I have 2 date fields: InDate and OutDate. If there is an OutDate, then...
|
by: CSDunn |
last post by:
Hello,
I have an Access 2003 report that opens in print preview and then
maximizes upon clicking a button from a form. The OnClick event of the
button fires a macro to open the report.
How can...
|
by: jkearns |
last post by:
Hello,
I made a report from a crosstab query following the steps onlined in
MSDN's Solutions.mdb example. I now have a dynamic crosstab report
(great!), but with one minor problem. I cannot get...
| |
by: Kapil Shah via DotNetMonster.com |
last post by:
Hello Everybody,
I am trying to write a crystal report function which should return a value
of 1 for crystal report with no parameter and return a value 2 for crystal
report with parameter.
...
|
by: Steve |
last post by:
Hi all,
I don't want to use the datagrid if I don't have to. Is there a way to
setup a ListBox to have more than one checkbox column?
I need something like this
| Include || Set as...
|
by: rizwanahmed24 |
last post by:
Hello
i have made a custom control. i have placed a panel on it. I want this
panel to behave just like the normal panel. The problem i was having is
that the panel on my custom control doesnt...
|
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== |
last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing
an .RLDC report in local report.
The columns for the report are essentially:
Month Item #1 Item#2 Item#3
...
|
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: 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...
| |
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
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 ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |