473,472 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to remove duplication of data in subreport

5 New Member
Hi...
Am developing a resume data retrieving software where data is stored in one parent table and 4 child tables as such:
Resume_table ----> Parent table
holds ----> Res_ID, Emp_ID, Lang_ID, Task_ID & some other static data

Employee_Table--->which is referenced directly to Resume_Table.Emp_ID
similarly ol other 3 tables are referenced to the main parent table

Storing and retrieving data is all working fine as long as I am retrieving 1 record for each child tables

But some times there might be couple of languages and only single records for other child tables.In dat case as the four child tables are ol in separate subreports whch are called onto the main report whch prints as cv gives redundancy in data i.e by giving duplication of ol records twice which were single records during entry, which i think follows the language table if it consist of 2 records.

am using a join query to call these records onto crystal report...
Expand|Select|Wrap|Line Numbers
  1. SELECT Distinct Education_Table.Edu_ID AS Education_Table_Edu_ID, Education_Table.Institution, Education_Table.Years_Edu, Education_Table.Edu_Description, Employment_Record.Emp_ID AS Employment_Record_Emp_ID, Employment_Record.From_Dt, Employment_Record.To_Dt, Employment_Record.Employer, Employment_Record.Pos_Held AS Employment_Record_Pos_Held, Language_Table.Lang_ID AS Language_Table_Lang_ID, Language_Table.Lang_Name, Language_Table.Lang_Speaking, Language_Table.Lang_Reading, Language_Table.Lang_Writing, Resume_Table.ResID, Resume_Table.Proposed_Position, Resume_Table.Firm_Name, Resume_Table.Resume_Name, Resume_Table.Dt_Birth, Resume_Table.Country_Work, Resume_Table.Profession, Resume_Table.Years_Group, Resume_Table.Nationality, Resume_Table.It_Skills, Resume_Table.Edu_ID AS Resume_Table_Edu_ID, Resume_Table.Lang_ID AS Resume_Table_Lang_ID, Resume_Table.Emp_ID AS Resume_Table_Emp_ID, Resume_Table.Details_Task_Assignd, Resume_Table.Assgnmt_ID AS Resume_Table_Assgnmt_ID, Resume_Table.Certification, Resume_Table.Staff_Member, Resume_Table.Authorised_Rep, Tasks_Assigned.Assgnmt_ID AS Tasks_Assigned_Assgnmt_ID, Tasks_Assigned.Name_Assgnmt, Tasks_Assigned.From_Assgnmt, Tasks_Assigned.To_Assgnmt, Tasks_Assigned.Location, Tasks_Assigned.Client, Tasks_Assigned.Proj_Features, Tasks_Assigned.Pos_Held AS Tasks_Assigned_Pos_Held, Tasks_Assigned.Act_Performed FROM Tasks_Assigned INNER JOIN (Language_Table INNER JOIN (Employment_Record INNER JOIN (Education_Table INNER JOIN Resume_Table ON Education_Table.[Edu_ID] = Resume_Table.[Edu_ID]) ON Employment_Record.[Emp_ID] = Resume_Table.[Emp_ID]) ON Language_Table.[Lang_ID] = Resume_Table.[Lang_ID]) ON Tasks_Assigned.[Assgnmt_ID] = Resume_Table.[Assgnmt_ID] WHERE (((Resume_Table.ResID)=" & Integer.Parse(txtResumeID.Text) & "));"
  2.  
any help is really appreciated....
Thanx
Aug 6 '10 #1
3 1400
Aimee Bailey
197 Recognized Expert New Member
Avoid using nested joins, instead maybe try using a HAVING clause, or a sub-query that finds records appropriate for your needs. Also try and stay away from the DISTINCT keyword unless its absolutely nessisary.

Two cents brought to you by Aimee ;)
Aug 10 '10 #2
murtazadoc
5 New Member
wud ye mind elaborating it a bit more with context to my query...?
Cause hv been tring arnd lately bt havent found ny soln till yet...
have simplified d code
Expand|Select|Wrap|Line Numbers
  1. SELECT r.Proposed_Position, r.Firm_Name, r.Resume_Name, r.Dt_Birth, r.Country_Work, r.Profession, r.Years_Group, r.Nationality, r.It_Skills, r.Details_Task_Assignd, r.Staff_Member, r.Authorised_Rep, ed.Institution, ed.Years_Edu, ed.Edu_Description, em.From_Dt, em.To_Dt, em.Employer, em.Pos_Held, l.Lang_Name, l.Lang_Speaking, l.Lang_Reading, l.Lang_Writing, t.Name_Assgnmt, t.From_Assgnmt, t.To_Assgnmt, t.Location, t.Client, t.Proj_Features, t.Pos_Held, t.Act_Performed FROM (((Resume_Table AS r INNER JOIN Education_Table AS ed ON r.ResID = ed.Res_ID) INNER JOIN Employment_Record AS em ON r.ResID = em.Res_ID) INNER JOIN Language_Table AS l ON r.ResID = l.Res_ID) INNER JOIN Tasks_Assigned AS t ON r.ResID = t.Res_ID WHERE(((r.ResID) = " & txtResumeID.Text & ") or ((em.Res_ID) = " & txtResumeID.Text & ") or ((ed.Res_ID) = " & txtResumeID.Text & ") or ((l.Res_ID) = " & txtResumeID.Text & ") or ((t.Res_ID) = " & txtResumeID.Text & "))"
  2.  
  3.  
Sep 19 '10 #3
MrMancunian
569 Recognized Expert Contributor
Would you mind just using proper English instead of using abbreviations? Try using Aimee's two cents in your query and if you can't make it work, come back and post your new query.

Steven
Sep 23 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tonya | last post by:
Hi, i wanted to know how i could resolve the following error message: An unhandled exception of type 'System.ArgumentException' occurred in system.dll Additional information: The data grid...
0
by: Jawahar Rajan | last post by:
All, I have a datagrid that I use in a ASP.net web page that loads customer data based on the selected customer ID Some Customers will have no data in the database (which is oracle 9.2) . So I...
20
by: Steve Jorgensen | last post by:
A while back, I started boning up on Software Engineering best practices and learning about Agile programming. In the process, I've become much more committed to removing duplication in code at a...
7
by: gilad | last post by:
Hi, I would like to add some code to system.data so I can trace calls to SqlConnection class. I used ildasm.exe, got the il code, added some of mine and used the ilasm.exe to get a new assembly. ...
5
AMT India
by: AMT India | last post by:
Is there is any method to avoid the POST Data warning while clicking on the 'back' button of the browser?
0
by: Michel Esber | last post by:
Hello, Linux RedHat AS4 running DB2 V8 FP15. I have very large tables (100 Million+ rows), and I only need to keep 6 months of data online/available. The tables have a timestamp field. I...
3
by: jif20 | last post by:
Hello, basically i have a 2D matrix 'a'. It contains both data i want to use and data i want to ignore. e.g. 'a' matrix: 1.937145 -0.500000 -1.333333 0.000000 -0.103812 ...
2
by: peace2007 | last post by:
Hi, I'm working on MS SQL 2005 and need to delete all data from a relational DB via a stored procedure. Any idea is appreciated Regards
0
by: EManning | last post by:
Using 2003. I've got a main report with a subreport and within that subreport is another subreport, all bound. The detail in the 2nd subreport is repeated multiple times for some reason. The...
3
by: ishanisircar | last post by:
Hi all, I am using a Gridview which displays a calendar. when i click on the calendar, the date should be inserted in my database. but instead i get this error. ...
0
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...
0
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,...
0
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,...
0
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...
1
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...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 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.