473,769 Members | 6,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help me in this report

Hi all,
I am not so good in queries. here is my problem

2 tables to store the received items (fabric)-- inwardmaster,
inwarddetails

and after some processing (Dyeing)

the items were deliverd and stored in tables -- deliverymaster,
deliverydetails

some times it may me returned without processing (grey fabric) and
stored in -- returnmaster and returndetails

lng_LI_RecordNo is the primary and used in delivery and return tables.

i want to take a report like this

STATUS REPORT BETWEEN 01/9/2005 AND 30/9/2005

--------------------------------------------------------------------------------
CUSTOMER NAME OPENING BALANCE INWARD QTY DELIVERD QTY RETURN QTY
CLOS.BAL
--------------------------------------------------------------------------------

i tried to calculate like this

first get the customers who gave fabric < 01/09/2005
start customer loop

get total inward qty of customer < 01/09/2005
get total delivery qty of customer < 01/09/2005
get total return qty of customer < 01/09/2005

opening balance = total inward qty - (devliered qty + retured qty)

get total inward qty of customer between 01/09/2005 and 30/09/2005
get total delivery qty of customer < 01/09/2005 and 30/09/2005
get total return qty of customer < 01/09/2005 and 30/09/2005

Closing balance = opening balance + total inward qty - (devliered qty
+ retured qty)

update values in new table and show it in crystal report.

end customer loop

with this method it takes more than 45 minutes to get the report, pls
help me to write a single query which does all this or help me the
other way to get the report fast. i use vb6 with access 2000.

pls help me.

prabhu.

Nov 13 '05 #1
1 1800
pr**********@gm ail.com wrote:
Hi all,
I am not so good in queries. here is my problem

2 tables to store the received items (fabric)-- inwardmaster,
inwarddetails

and after some processing (Dyeing)

the items were deliverd and stored in tables -- deliverymaster,
deliverydetails

some times it may me returned without processing (grey fabric) and
stored in -- returnmaster and returndetails

lng_LI_RecordNo is the primary and used in delivery and return tables.

i want to take a report like this

STATUS REPORT BETWEEN 01/9/2005 AND 30/9/2005

--------------------------------------------------------------------------------
CUSTOMER NAME OPENING BALANCE INWARD QTY DELIVERD QTY RETURN QTY
CLOS.BAL
--------------------------------------------------------------------------------

i tried to calculate like this

first get the customers who gave fabric < 01/09/2005
start customer loop

get total inward qty of customer < 01/09/2005
get total delivery qty of customer < 01/09/2005
get total return qty of customer < 01/09/2005

opening balance = total inward qty - (devliered qty + retured qty)

get total inward qty of customer between 01/09/2005 and 30/09/2005
get total delivery qty of customer < 01/09/2005 and 30/09/2005
get total return qty of customer < 01/09/2005 and 30/09/2005

Closing balance = opening balance + total inward qty - (devliered qty
+ retured qty)

update values in new table and show it in crystal report.

end customer loop

with this method it takes more than 45 minutes to get the report, pls
help me to write a single query which does all this or help me the
other way to get the report fast. i use vb6 with access 2000.

pls help me.

prabhu.

45 Minutes!!!! Wow! That doesn't say much for Crystal Reports.

Here's a method I may use in Access.

I may have a form called CallRpt. In it I would have 3 text fields that
store dates; LessThanDate, BetweenFromDate , and BetweenToDate.

I would then create 6 queries that do totalling. Ex:
Select inwardmaster.cu stomerid,
Sum(inwardDetai l.inwardqty) As InDelTot _
from inwardmaster INNER JOIN inwardDetail On _
inwardmaster.ln g_LI_RecordNo = _
inwardDetail.ln g_LI_RecordNo _
Where inwardDetail.In wardDate < LessThanDate _
Group By inwardmaster.cu stomerid

This will select all customers with records less than the LessThanDate.

Select inwardmaster.cu stomerid,
Sum(inwardDetai l.inwardqty) As InDelTot _
from inwardmaster INNER JOIN inwardDetail On _
inwardmaster.ln g_LI_RecordNo = _
inwardDetail.ln g_LI_RecordNo _
Where inwardDetail.In wardDate Between _
[Forms]![CallRpt]![FromDate] And _
[Forms]![CallRpt]![ToDate] _
Group By inwardmaster.cu stomerid

This query will select and total all qty by customerid with dates
between the From/To Dates.

Now do the same thing for Returns and Deleivery.

You now have 6 queries with the sums for all six Totals that you require.

You now need a "master" query to link the customerID to all of the other
queries. Perhaps one of these 6 can be the master. Basically, you want
to only select customer records that has a record in 1 of these 6 queries.

Lets use the customer table as the master. Drop that and the 6 queries
into the query builder. Now create a relationship line of customer Id
to all 6 tables. Right click the relationship line and set it to All
records in Customer and only those that match for the table in the
relationship.

Now you can filter this table down where you check the value of the Sum.
I would use IsNull. Ex:
Not IsNull(InDelTot ) Or Not IsNull(ReturnTo t) Or Not
IsNull(Delivery Tot)....etc.

Now you have a query that will select only customers that have an
inward, delivery, or return record that meets the time frames specified.
If the customr has no records, all of the "sum" fields will be null.

From here you can use the report writer to perform calculations on the
fields.

This will bring down the reporting function from 45 minutes to about 2
seconds.
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4031
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at runtime, the report still showed the results from the default query (from within the Crystal Report). Then I tried the XSD solution where you define a dataset (that mataches the database and the Crystal Report) and have the Crystal Report use this....
5
2799
by: MGFoster | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've converted an ACC97 .mdb file to an ACC2K2 .adp. A report that worked in ACC97 doesn't work in ACC2K2. Report setup: ACC97 ACC2K2 (SP-2) -------------- ---------------------------
1
1535
by: Simon Matthews | last post by:
Hope someone can help an Access beginner! I've just started keeping my surgical logbook on access and it's a simple flat-file affair. I have created several queries that will list cases performed at different hospitals and reports based on the queries to print out the relavent details. What I would like to do is have a summary sheet in the Report Footer section that lists a grid of each type of procedure performed as well as the...
5
2200
by: Steve Patrick | last post by:
Hi All You guys are my last hope, despite spending money on books and hours reading them I still can not achieve the results I need. I have designed a database in Access 2000 based on 1 table, all has gone very well with one exception. The table is based on applications made by potential customers looking to buy franchise rights to particular locations and as part of the process they are asked to list their preferred locations 1 to 4....
15
4403
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows of students and columns of activities and the data are the students' scores in each activity. No problem, almost. The problem is that there are five classes at the moment and will be more classes (or courses) in future semesters. I don't want...
3
3788
by: Deasun | last post by:
I need some help please! Crystal is driving me nuts. Heres my code so far, see below. Problem: On the .export() line it comes back with error #5 Login failed! I know the login info is good so why is the bloody thing doing this. The paths have been checked and are correct. The crystal Report is a .rpt file. Not one created in the VS.net IDE but in crystal itself.
1
4159
by: PlumeProg | last post by:
Hello, I can't find a way to bind a dataset at runtime as a source for my report source. I looked into msdn and found some sample : ms- help://MS.VSCC/MS.MSDNVS/crystlmn/html/crtskaccessingsecure databases.htm ' Declare require variables. Dim logOnInfo As New TableLogOnInfo()
6
4997
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
3
1777
by: DeanL | last post by:
Hi guys, I'm in need of a little help with a report I'm setting up on Access 2000. The report shows data depending on entries on a form that has 7 fields (Min and Max Cost, Fiscal Year, Min and Max Award Dates, Reviewer, Engineer). Some of these fields may have wild card characters (*) and some real data in them. The problem I have is when the user hits the Go button I need to have some text fields on the report show data from the...
3
3012
by: jambonjamasb | last post by:
Hi I have two tables: email_tbl Data_table Data table is is used to create a Form Data_form
0
9587
marktang
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...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
Oralloy
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...
0
10045
jinu1996
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...
0
9863
tracyyun
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...
0
8870
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
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...
0
6672
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3958
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.