Topic: choose a heading

i am trying to choose a heading (league) and then print all of the teams with their members belonging to the league. i have tried to follow the previous examples and havent been able to get it to work. dont know where i am going wrong with this.

Post's attachments

Attachment icon My Sample 4.zip 27.96 kb, 524 downloads since 2016-07-15 

Re: choose a heading

You talk about form "selleague"? for this purpose enough TableGrid1 and button "Print Team Roster"

To filter records by league, you should write WHERE section in the SQL query like this:

sqlquery('select  id, teamname, teamno from teams WHERE id_league='+selleague.TableGrid1.sqlValue, teams);

But I noticed that your database structure have many mistakes, thus I can't write for you correctly SQL queries.

Dmitry.

Re: choose a heading

hello Dmitry

thanks for the help. since i am new to this and i have no formal education on databases or programming could you point out the many structural mistakes for me so i can get this fixed and running properly? i would appreciate the info and help.

lee

Re: choose a heading

does this take care of my database structure? still looking for help on this.

lee

Post's attachments

Attachment icon Drawing1.png 36.54 kb, 410 downloads since 2016-07-27 

Re: choose a heading

lhimes wrote:

does this take care of my database structure? still looking for help on this.

lee

Unfortunately I can help you only with specific question.

Dmitry.

Re: choose a heading

hello dmitry

previously you told me there were several structural mistakes in my database. i asked what they were. i restructured my db and am asking if this structure is without mistakes.

lee

Re: choose a heading

lhimes wrote:

hello dmitry

previously you told me there were several structural mistakes in my database. i asked what they were. i restructured my db and am asking if this structure is without mistakes.

lee

I just can't to check your database structure, because I don't know anything about this sport subject.

Dmitry.

Re: choose a heading

good morning Dmitry

i am confused.  in a previous post on this subject you wrote "But I noticed that your database structure have many mistakes, thus I can't write for you correctly SQL queries.". i am trying to fix the problem not knowing what it is. i dont seem to be able to find out what exactly it is i am trying to fix. what was it that you noticed were the many mistakes?

Re: choose a heading

can i get a answer to my last post

Re: choose a heading

hello Dmtry

please answer this so i can fix it and go on with the project. i really dont want to have to trash this after spending so much time on it.

lhimes wrote:

good morning Dmitry

i am confused.  in a previous post on this subject you wrote "But I noticed that your database structure have many mistakes, thus I can't write for you correctly SQL queries.". i am trying to fix the problem not knowing what it is. i dont seem to be able to find out what exactly it is i am trying to fix. what was it that you noticed were the many mistakes?

Re: choose a heading

lhimes

I can't check your database without more details about your project, thus to find all database mistakes and correct it need at least 2-3 hours. I just can't spend more that 15-20 min to solve one question on forum.

Dmitry.

Re: choose a heading

hello again Dmitry

my project in its basic form is not all that complicate and would apply to almost any sport. almost every sport has a national organization running it. under it are the various areas represented (my leagues). each area represented has its teams that play and the members that play on the team. there are reports of all the team members, the team statistics and player statistics. my project in a nutshell manages everything from the area to the reports. i submitted my erd the way i thought it should be. if that met with your approval i could get on with my project and my  questions could be more specific to a particular problem i am having at the time.

thank you again for your help for me and the others

lee

Re: choose a heading

Lee,
I took a look at your project mainly focusing on your database structure and the one report you had issues with and not so much with your data flow in your forms. Keep in mind when defining database tables that when you are creating related tables that you have your child tables pointing to parent tables. So in your project players table should be pointing to teams table and teams table should be pointing to league table and I think league table should be pointing to seasons table and for the most part you do have it that way. I am assuming that you have multiple leagues in a season. One mistake I see is that you have the League table pointing to teams and you have teams pointing back to league. And your League is not pointing to Seasons. So one correction would be to change the League relationship field from Id_Teams to Id-Seasons and then remove the id_league field from Seasons. Your Matches should be pointing to teams so remove the id_Matches from the Teams tables. I'm not sure what the purpose of the Teammates table is. Why can't you define all the team players and the team statistics in the Teams table. For that matter if you are only using the Players table to store the player's name, why can't you just store the player's name in the Teams table. I am assuming that you only have 2 or 4 players on a team. It seems like having the Teammates table is making it much more complicated than it should be. Your matches then would only need to point to teams and it's associated players. I did not change any of the structures in the attached project.

The next thing I looked at was your actual data in the tables using SQLiteStudio. I know this data is only test data, but none of your tables had any of the related fields filled in which tells me that your forms are not filling in this data properly which means your report won't work either. As far as your report is concerned, you defined each of your tables in script as separate datasets with no joining of the tables. I changed your print button in the attached project to REPORTSQL instead of using the script and defined the joining of related tables in the Select statement. The report definition was changed to incorporate the Group Headers for League and Teams. I manually filled in some of the missing related data so the report would work. Select the Tuesday Night league when viewing the report.

Like I said I did not look into how your forms are flowing the data. There could be other flaws, but maybe this can get you back on track with your project. I can't spend too much time either, but I'll try to help where I can. Maybe Derek can chime in since it seems he is more familiar with your project.

Post's attachments

Attachment icon My Sample 4 Revised.zip 363.21 kb, 548 downloads since 2016-08-05 

Re: choose a heading

hello ehwagner

i am not sure which version you were looking at but i think it may have been an older one. in one of my posts just before my last one i enclosed a totally new schema the way i thought it should be from what i could get from the various instructional videos. i have just added more to it and attach it with this. i will try to explain it as i think i have learned.:
there are 2 venues and each can have many leagues. each league can have only one venue so a one to many relationship there. each league can have many seasons and each season one league. another one to many relationship. each season can have many teams and team can  play on many seasons. a many to many relationship which requires another entity in between (weeks). each team can play many matches and a match can be played by many teams. another many to many relationship requiring an entity in between.( team statistics). a team can have many team mates but a team mate can only be on one team. a one to many relationship. a team mate can have many players and a player only be one team mate. a one to many relationship.

Derek seems to understand my project fairly well and has been a tremendous amount of help and i am very grateful for that. he has his own thing he has to take care of and is unable to devote much time also. he does help when he can though.

i want to thank you also for taking the time to help me. it has been a very frustrating journey so far.

lee

Post's attachments

Attachment icon Drawing1.png 49.72 kb, 332 downloads since 2016-08-06