displaying all groups of data in ssrs - sql

i have a student table that has each student with 10 rows for the 10 subjects he undertakes
.in the header section there is a field for school name and students name in the body section there is a table with subject and scores when i use a filter of one student it displays expected results but when i do not apply filters it displays only one name in the headers section and a continuous rows of all student record but i want it to display each student name and school name on different pages plus their records[This are part of the desired results][1]
This is how each page should look like

If I understand you question correctly you want to show student detail on each page (one student on one page if 10 student show 10 page) right ?
First, Add List to you body and move all control to List then group on student name or unique field to student.
Then. In List Properties Set Page break between each instance of a group.
you can see this question to guide.

Related

MS Access - Query - Required Forms for Each Employee

I have 3 tables, all SharePoint lists. I am trying to create a query that will show me all of the required DQ_File Forms that do not have an attachment in the DQ_File.
DQ_File_Lookup is a lookup table for the description field in the DQ_File. It also has the "DQRequired" flag I am looking for to see all of the required fields that do not have an attachment.
I have included a screen shot showing the table layouts and relations.
Any help would be appreciated, I am sure I am just overlooking something obvious.
A example would be as follows:
Employee Name | Document Name
You would have employee Joe and he has forms A,B,D out of a possible forms A,B,C,D,E,F so he would be missing forms C,E and F.
So the employee name would come from the employee table, and the document name needs to get passed through the DQ_File Table from the DQ_File_Lookup
the way I thought to do it was to get it to show all documents from the DQ_File table that are missing, that I can do. But that only shows the information that has an entry. There are certain forms that are required for every employee that I want to be able to see if a employee is missing any of those forms.
Using what #June7 posted below I got it to work, and it now will show me all 15 documents that are required for every driver. But when I add the attachment field from DQ_File it shows them all as zero attachments, when I know some of them do indeed have attachments already.
Here is a screen cap showing this.
Williams in particular should only have about 5 documents that should be on this list, but instead it is showing like all 15 are missing.
Here is the SQL from the combined query:
SELECT [qryEmployees+DQFileLookup].Last, [qryEmployees+DQFileLookup].Description, DQ_File.Attachment
FROM DQ_File RIGHT JOIN [qryEmployees+DQFileLookup] ON DQ_File.EmployeeNo = [qryEmployees+DQFileLookup].EmployeeCode
WHERE (((DQ_File.Attachment.FileURL) Is Null) AND (([qryEmployees+DQFileLookup].CURRENT)=True) AND (([qryEmployees+DQFileLookup].DRIVER)=True) AND (([qryEmployees+DQFileLookup].DQRequired)=True));
If you want to know which required docs employees do not have, then need a dataset of all possible combinations of employees/docs. Then match that dataset with DQ_File to see what is missing. The all combinations dataset can be generated with a Cartesian query (a query without JOIN clause) - every record of each table will associate with every record of other table.
SELECT Employees.*, DQ_File_Lookup.* FROM Employees, DQ_File_Lookup;
Then join that query with DQ_File.
SELECT Query1.EmployeeID, Query1.First, Query1.Last, Query1.ID, Query1.Title, Query1.DQRequired, DQ_File.Description, DQ_File.EmployeeNo
FROM DQ_File RIGHT JOIN Query1 ON (DQ_File.EmployeeNo = Query1.EmployeeID) AND (DQ_File.Description = Query1.ID)
WHERE (((Query1.DQRequired)=True) AND ((DQ_File.EmployeeNo) Is Null));
Advise not to use exact same field names in multiple tables. For instance, Title in DQ_File_Lookup could be DocTitle and Title in Employees could be JobTitle. And there will be less confusion if ID is not used as name in all tables.
It seems unnecessary to repeat Title and [Compliance Asset ID] in all 3 tables.
Strongly advise not to use spaces in naming convention. Title case is better than all upper case.

How would I go about inserting data into one-to-many(must) relation, psycopg2/python in PostgreSQL

Using psycopg2/python how would I go about inserting data if I'd have something like from this img.
GRUPA (class GROUP) must contain one or more STUDENT's
How to fill them up and how to add them after, I can't add a GROUP without a student and I can't add a STUDENT w/o a GROUP.
Must it be a transaction/deferrable-constraints to add them in batch/together just to create GROUP?
What options do I have, how would you do it?
Thanks.
I'm not sure why you have an id_group in the students table. It doesn't really make sense.
But if you do, make it null-able. Then you can:
Add a student into the table with a null value for id_group.
Add a group, with the student.
Update the students table with the value for the group.
However, you might also want to relax your requirements. For instance, perhaps a group could have no students. It wouldn't be a very active group, but the group can exist as a separate entity.
In fact, a more natural way to represent this data would be:
A students table with one row per student and no group reference.
A groups table with one row per group and no student reference.
A studentGroups table with one row per student in each group.

Dynamic Form Elements in Access

I am working on a project in Access 2016 and VBA, that contains a table that stores the details of students (StudentID, EnrollmentNo, Name, Center, etc) and another that contains the attendence (having fourcolumns: ID, StudentID, DateOfClass, IsPresent).
I want to create a form displaying multiple rows, each row belonging to a each student displaying (Enrollment No, Name, DateOfBirth, DateOfClass, IsPresent) and finally want to input the isPresent field using check box and then save the information for all/add new information.
Is there any way to do this ?
Here I am concerned about the form. How do I CREATE such a form (like Datasheet view) where I have a list of students column wise (with their details like enrollment number etc.) and IsPresent (check box type thing) in the next. So that If I like to input attendence in the attendance table I could just set the date and mark the checkboxes in front of students and then press a button which adds all the data to the table.
No table of classes/subjects? Only 2 tables? You have to do data entry into Attendance. Could only create records for students that attend so the IsPresent field would not be needed. If you want record for student even if not attending then, yes, need IsPresent.
If you want to 'batch' create records for all students for a particular date, run INSERT SELECT sql action.
INSERT INTO Attendance(StudentID, DateOfClass) SELECT StudentID, [enter date value] AS DateOfClass FROM Students;

MS Access Text Search Box with referenced values

Lets assume I have 2 tables: Projects and Employees. Each project got one responsible employee that I chose as a Lookup Value from the Employee table.
Now I understand that Access saves the ID of the employee in the project table and that's good. However, now I want to create a search query to get all projects with e.g. Mike as responsible person.
This is my code:
SELECT projects.name, projects.responsible
FROM projects
WHERE projects.responsible = Forms!form_search!employee_name;
Now it works fine if I type in the Form the employee ID but I cannot remember all IDs. I want to be able to type in 'Mike' in the Form and the query delivers me still all of Mike's projects.
How can I achieve that?
I thought about something like:
WHERE (projects.responsible = (employees.ID WHERE employees.name = Forms...));
But this doesn't work...
You can use a dropdown list with 2 columns as a filter criteria.
To fill this list, you make a request on your employee table, hide the first column (0cm wide) and the second column would display the matching employee name but your SQL request still receive the ID as criteria.
You should NOT have to modify your SQL request.

Reporting Services hiding duplicates by using SQL Server 2005

I want to create a report based on 3 tables called Physician, Credentials and Insurance. All these tables are related to Physician and linked by physician Id.
I want to display rows based on physician id but suppress the duplicate values. How to display the physician, credentials and insurance details in one report based on physician id?
Here the problem is one physician contains more than one credential and insurance details. Suppose for physician id=1 he contains credentials like A,B and and insurance like C,D my report is coming like this
physician id credentials insurance
1 A C
1 A D
1 B C
1 B D
BUT I want my report like
physician id credentials insurance
1 A C
B D
SO I want to display the details once and want to hide the duplicate values
Is there any possibility by using sub reports please mind I am using SQL Server 2005 and ssrs 2005.
Sorry for my bad language plz help for this thanks #anil#
Add a 3 column table to your report
Create a group on PhysicianID
Make PhysicianID the value in the first column on the group header row
On the 2nd column, add a List.
Right click the List and click properties --> Edit details group...
Select =Fields!Credentials.Value in the group on expression dropdown
Add a textbox to the list and set value to =Fields!Credentials.Value
Follow steps 4-7 for the 3rd column
Summary:
Add a List to a group header and group the list by the value you want to get the "distinct" value, the put that value in a textbox, which will then repeat for that group.