Senin, 12 Agustus 2013

[MS_AccessPros] Union Query MS Access 2010

 

Hi All,
I'm having some trouble with a display issue with a UNION query in MS Access 2010.

I am getting all the expected results, but am not getting the value I want to display in one of the columns (Department). The results in the first column "Department" is correct, but it is displaying the RecordID number instead of the Department (Name). For example, instead of displaying "Youth Department" in the column "Department"...it is displaying the RecordID "14" which is the correct value, but I want the name or description of the value. When I run the two queries separately it works fine and returns the right value I'm looking for, but when I combine them in a UNION then it just displays the RecordID instead of the description (see my examples below). The field and data types in both queries are the same.

My UNION query is based on two queries and NOT Tables.

SELECT [QRY Department Transactions Summary].[Department], [QRY Department Transactions Summary].[Total Income], [QRY Department Transactions Summary].[Total Expense], [QRY Department Transactions Summary].[Total Balance Amount]

FROM [QRY Department Transactions Summary]

UNION

SELECT [QRY WF Transactions Summary].[Department], [QRY WF Transactions Summary].[Total Income], [QRY WF Transactions Summary].[Total Expense], [QRY WF Transactions Summary].[Total Balance Amount]

FROM [QRY WF Transactions Summary];

Output results set currently displayed as:

DepartmentTotal IncomeTotal ExpenseTotal Balance
14$0.00 ($29,140.00)($29,140.00)
14$11,825.00 ($230.00)$11,595.00

Desired output results set:

DepartmentTotal IncomeTotal ExpenseTotal Balance
Youth Department$0.00 ($29,140.00)($29,140.00)
Youth Department$11,825.00 ($230.00)$11,595.00

>>> On 8/12/2013 at 2:02 PM, in message <DUB122-DS1A2D0FE419893140C183EB05B0@phx.gbl>, John Viescas <JohnV@msn.com> wrote:

Jim-

You won't find object properties in any of the system tables. To get to the
properties, you either have to walk through DAO TableDefs or QueryDefs or
open Forms and Reports in at least Design view from either Documents or the
AllForms or AllReports collections.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of luvmymelody
Sent: Monday, August 12, 2013 6:23 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] View Object Properties

Is there a system table that shows the Object Properties? I went through all
of the System objects and did not see any. I am rebuilding a database object
by object to delete any legacy objects. So I am writing legacy in the object
properties. But I would like to write a query based on the object properties
to get a list of the legacy objects, but I cannot find the system table with
that information in it.

Thank You

Jim Wagner

------------------------------------

Yahoo! Groups Links

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar