Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 30th, 2009, 05:53 AM
bonnim bonnim is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 7 bonnim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 44 m
Reputation Power: 0
Problem Creating Query

Hi,

I have created the following query:

SELECT [Economic Capital and Stress Testing].Comment, [Regulatory Issues].Comment, [Risk Appetite].Comment, [Trans-risk Diversification and Concentration Risk].Comment, [Economic Capital and Stress Testing].[ICAAP Submission], [Economic Capital and Stress Testing].Site
FROM (([Economic Capital and Stress Testing] INNER JOIN [Regulatory Issues] ON [Economic Capital and Stress Testing].[ICAAP Submission]=[Regulatory Issues].[ICAAP Submission]) INNER JOIN [Risk Appetite] ON [Regulatory Issues].[ICAAP Submission]=[Risk Appetite].[ICAAP Submission]) INNER JOIN [Trans-risk Diversification and Concentration Risk] ON [Risk Appetite].[ICAAP Submission]=[Trans-risk Diversification and Concentration Risk].[ICAAP Submission]
WHERE ((([Economic Capital and Stress Testing].[ICAAP Submission])=[Enter Submission]) AND (([Economic Capital and Stress Testing].Site)=[Enter Site]) AND (([Regulatory Issues].[ICAAP Submission])=[Enter Submission]) AND (([Risk Appetite].[ICAAP Submission])=[Enter Submission]) AND (([Trans-risk Diversification and Concentration Risk].[ICAAP Submission])=[Enter Submission]) AND (([Regulatory Issues].Site)=[Enter Site]) AND (([Risk Appetite].Site)=[Enter Site]) AND (([Trans-risk Diversification and Concentration Risk].Site)=[Enter Site]));

This query only works if information has been inputted in each of the 4 tables (EC, Trans-Risk, Regulatory and Risk Appetite).

Is there a way of making this query work even if information has not been inputted into one of these tables?

Thanks!!

Reply With Quote
  #2  
Old June 30th, 2009, 05:58 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,416 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 23 h 57 m 27 sec
Reputation Power: 1800
Hi,

Without seeing a sample of your data and a description of your tables its hard to understand exactly what you are trying to achieve, but I would recommend that you use an OUTER JOIN instead of an INNER JOIN.

The outer join will return all rows from one table even if no corresponding record exists in the other table. Check out this definition of Join types

Reply With Quote
  #3  
Old June 30th, 2009, 06:32 AM
bonnim bonnim is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 7 bonnim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 44 m
Reputation Power: 0
Hello!

Thank you very much.

I am sorry I should have been more specific.
The job of the database is to pass comments on certain documents by various colleagues. Eg. A Dec Report is available, I want to write my comments, then I want a colleague to give her comments, then another colleagues gives his etc. I then want to create a report so that all comments on this document can be sent back to the people who gave us the report in the first place.

I have a table for each colleague who will be responding, including the date of the document, the document owener and the comments made. Here is a sample:

Economic Capital and Scenario Analysis (Table which will be for my comments)
ICAAP Submission (the date of the document which I will be writing about)
Site (the area which the document relates to)
Comments (the comments I will be making).

I did try to put all of this information in one table, but it was impossible to create a report!! I think this is the only way to do it, but I am not sure how to make the query good enough!

Thanks once again!

Reply With Quote
  #4  
Old June 30th, 2009, 09:46 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,416 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 23 h 57 m 27 sec
Reputation Power: 1800
Hi,

I'm not sure if I understand your requirement correctly but I would recommend that a link table would be a better approach to take. eg:

tblReports:

report_id autonumber
report_detail text

tblComments:

comment_id autonumber
comment_detail text

tblUsers:

user_id autonumber
user_forename text
user_surname text

tblLink:

report_id number
comment_id number
user_id number

The job of the link table would be to link everything together, heres some sample data:

tblReports:

report_id report_detail
1 Economic Capital and Stress Testing
2 Regulatory Issues
3 Risk Appetite

tblComments:

comment_id comment_detail
1 Great report
2 Very informative
3 Didnt enjoy it

tblUsers:

user_id user_forename user_surname
1 Joe Bloggs
2 Jane Doe

tblLink:

report_id comment_id user_id
1 1 1
1 2 2
2 3 1

Then to grab the comments for a given report:
Code:
SELECT r.report_detail, u.user_forename, u.user_surname, c.comment_detail FROM
tblReports r, tblComments c, tblUsers u, tblLink l 
WHERE r.report_id = l.report_id AND u.user_id = l.user_id 
AND c.comment_id = l.comment_id AND r.report_id = 1

I hope this helps, sorry if I have missed the point.
Comments on this post
don94403 agrees: This is a properly normalized relational database schema.

Reply With Quote
  #5  
Old July 1st, 2009, 11:01 AM
bonnim bonnim is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 7 bonnim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 44 m
Reputation Power: 0
Dear Sync or Swim,

Thank you so muich for your reply and efforts. Your intelligent response was a bit over my head and I am not quite sure how to adapt the 'link table concept to my problem. I am really sorry and I should have been clearer about my intentions. I will now try to explain clearly.

The role of the database is to capture comments made by various areas of my team, on certain reports. Once comments have been made on a report by the various members of my team, I would like to create a memo (or short report), to respond to the people who gave us the report.

If we take an example, the report will be 'UK Branch ICAAP' and the date of the report is 'Dec08'. The team areas which will comment on this report will be 'EC', Reg', 'R.App' and 'Meth'. What I did was create 4 tables - 'EC', Reg', 'R.App' and 'Meth'. Each table contains 3 fields - Submision (date of report) Site (UK Branch) Comments (a memo containing the comments).

I would like to create a query that will prompt for the Submission and the Site, and then pull out all comments made.

I will then be able to create a report containing all of the various comments.

Once I have the basics sorted I will be able to expand the database to make it more helpull (e.g. contain a field for progress so as to monitor if a Site is taking our comments on board).

Based on the above, is this possible?

Once again, thank you so much for your help so far.
Michael

Reply With Quote
  #6  
Old July 1st, 2009, 11:24 AM
bonnim bonnim is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 7 bonnim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 44 m
Reputation Power: 0
Thumbs up

Sorry Sync or Swim,

I forgot to mention that the data in each table is linked by Submission (the date, which is usually quarterly or semi-annually) and also the site.

E.g

EC
Submission Site Comment
Dec08 UK txt
Dec08 NY txt
Dec08 HK txt
Jun08 UK txt

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Problem Creating Query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT