Hi Experts
I need your help once again.
I am using this query to calculate total of (price*quantity), and gst grouping the products by main category codes; i.e for all Metals; non metals etc.
Query has no error but the result isn't correct.
It displays double of total and gst for each category; when I print closing summary reports it doubles the total price for all categories.
here is what I have: Text in bold is problematic area.
SELECT control_info.gst, Group_codes.Group_ID,
Group_codes.Name, SUM(inv_detail.price * inv_detail.quantity) AS price1,
SUM(inv_detail.price * inv_detail.quantity * control_info.gst)
AS gst1
FROM product_codes, catagory_codes, inv_detail, inv_total,
Group_codes, control_info
WHERE group_codes.group_id = catagory_codes.group_id AND
product_codes.cat_code = catagory_codes.cat_code AND
product_codes.Item_code = inv_detail.item_code AND
inv_detail.tran_id = inv_total.tran_id
GROUP BY Group_codes.Group_ID, Group_codes.Name,
control_info.gst
10 1415
hi
try same query without grouping and summing. i think fields inv_detail.price and inv_detail.quantity are repeating themselves. problam lies in the join. correcting the join will solve the problam.
regards
manpreet singh dhillon hoshiarpur
Still con't fix it. Please help me
Still con't fix it. Please help me
I really think you'll get a better response on this in the Access forum. I'm going to move it over there.
Hi,
Try to Group by all the fields used in Select : -
Group By control_info.gst, Group_codes.Group_ID,
-
Group_codes.Name
-
Regards
Veena
How are we doing on this - any progress?
How are we doing on this - any progress?
I got this query fixed thanks for inquiring. But I had to add a new check with this query.
I am screwed up with a new check in the query thats is failing since last 24 hours.
I think I need help abt that. I'll post it today.
Hi Expert,
Please help me correct this query. I can't get desired results.
Here's what I want to do for accounts's summary report.
here is my query that has no error but can't print what I want.
current GST rate is stored in table control_info(gst)
I want to calculate total of paid amount for group codes present in table .group_code , gst paid from table inv_details.
GST is paid only if following two are true.
for those products that have pay_gst= true in product_codes
vendors that have gst# in table Vendor(gst_no) SELECT DISTINCT
control_info.gst, Group_codes.Group_ID, Group_codes.Name,
SUM(inv_detail.price * inv_detail.quantity * control_info.gst)
AS gst1
FROM product_codes, catagory_codes, inv_detail, inv_total,
Group_codes, control_info, vendor
WHERE group_codes.group_id = catagory_codes.group_id AND
product_codes.cat_code = catagory_codes.cat_code AND
product_codes.Item_code = inv_detail.item_code AND
inv_detail.tran_id = inv_total.tran_id AND
control_info.status = true AND
product_codes.pay_gst = true AND vendor.gst_no <> NULL
GROUP BY Group_codes.Group_ID, Group_codes.Name,
control_info.gst, vendor.account_no
Problem: the query calculates total of all the transections and does not care about Vendor's gst_no. However pay_gst fields is kep in consideration.
Any help will be highly appreciated.
Hi,
Check this:
And (vendor.gst_no IS Not NULL And Trim(vendor.gst_no) <> '')
Regards
Veena
no luck same result
I am worried
Just to let you know, I fixed the problem; Don't ask HOW? ; )
Terrible experience.
Kind Regards
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Brian Oster |
last post by:
After applying security patch MS03-031 (Sql server ver 8.00.818) a
query that used to execute in under 2 seconds, now takes over 8
Minutes to complete. Any ideas on what the heck might be going...
|
by: Andrew McNab |
last post by:
Hi folks,
I have a problem with an MS Access SQL query which is being used in an
Access Report, and am wondering if anyone can help.
Basically, my query (shown below) gets some records from a...
|
by: Apple |
last post by:
1. I want to create an autonumber, my requirement is : 2005/0001
(Year/autonumber), which year & autonumber no. both can auto run.
2. I had create a query by making relation to a table & query,...
|
by: lenny |
last post by:
Hi,
I've been trying to use a Sub or Function in VBA to connect to a
database, make a query and return the recordset that results from the
query. The connection to the database and the query...
|
by: StBond |
last post by:
Hi everyone,
I am new to Access and Visual Basic so things my be getting across a
bit cloudy. I only started using VB for one week.
I am having a little problem with the database that I am...
|
by: Andy_Khosravi |
last post by:
I have been trying to build a user friendly search engine for a small
database I have created. I'm having some particular problems with one
of my date fields.
Here's the setup:
I'm using...
|
by: Development - multi.art.studio |
last post by:
Hello everyone,
i just upgraded my old postgres-database from version 7.1 to 7.4.2.
i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with
copy-commands and to one file using...
|
by: mjsterz |
last post by:
I've been working with VB .NET for less than a year and this is the
first time I've posted on one of these groups, so let me apologize
beforehand if I'm being unclear, not posting my issue...
|
by: Juan Antonio Villa |
last post by:
Hello, I'm having a problem replicating a simple database using the binary
log replication, here is the problem:
When the master sends an update to the slave, an example update reads as
follows:...
|
by: HC |
last post by:
Hello, all, I started out thinking my problems were elsewhere but as I
have worked through this I have isolated my problem, currently, as a
difference between MSDE and SQL Express 2005 (I'll just...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: 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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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: 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,...
| |