Solved

Weird Column Name

Posted on 2004-10-07
5
802 Views
Last Modified: 2012-06-27
Still trying to get this report out!!    Have the following query that returns a weird name for the "Client" column and I need to query this query but cannot accurately reference that column.  HELP!

SELECT Client.[Soc Sec #], Client.Client, [FAPT Query Max Date].MaxOfDate, Client.DOB, Client.Sex, Client.Race, Client.Referral, Client.[CSA Start],  Encumbrance.[Service/Placement Type] As SvcType, Sum(Encumbrance.Encumbered) AS Encumbrd,Sum(Encumbrance.Adjustment) AS Adj, Sum(0) AS Expend
FROM (Client  INNER JOIN Encumbrance ON Client.Client=Encumbrance.Client) INNER JOIN [FAPT Query Max Date] ON [FAPT Query Max Date].Client = Client.Client
WHERE (Encumbrance.[FY 04-05]=Yes)
GROUP BY Client.[Soc Sec #], Client.Client, [FAPT Query Max Date].MaxOfDate, Client.DOB, Client.Sex, Client.Race, Client.Referral, Client.[CSA Start], Encumbrance.[Service/Placement Type]
UNION
SELECT Client.[Soc Sec #], Client.Client, [FAPT Query Max Date].MaxOfDate, Client.DOB, Client.Sex, Client.Race, Client.Referral, Client.[CSA Start], [Invoice Table].[Service/Placement Type] As SvcType, Sum(0) AS Encumbrd, Sum(0) AS Adj, Sum([Invoice Table].Amount) AS Expend
FROM (Client  INNER JOIN [Invoice Table] ON Client.Client=[Invoice Table].Client) INNER JOIN [FAPT Query Max Date] ON [FAPT Query Max Date].Client  = Client.Client
WHERE (([Invoice Table].[Check Date] Between #7/1/2004# And #9/30/2004#) And ([Invoice Table].[Account Number]<>"05309-9162"))
GROUP BY Client.[Soc Sec #], Client.Client,[FAPT Query Max Date].MaxOfDate, Client.DOB, Client.Sex, Client.Race, Client.Referral, Client.[CSA Start], [Invoice Table].[Service/Placement Type];

The result has the "Client" Column as something like  X7YZ_____1.Client

Why is it doing this and how do I reference the column in another query?

Sandie
0
Comment
Question by:SandieT04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 15

Expert Comment

by:jdlambert1
ID: 12252403
SITD... In the first SELECT clause only, try:

SELECT Client.[Soc Sec #], Client.Client as [Client], [FAPT Qu...
0
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 500 total points
ID: 12252416
Not certain why the fieldname is coming out like that but you could try aliasing it, i.e.:
Client.Client As ClientName

Otherwise, you should be able to reference it in another query like so:
[X7YZ_____1.Client]
0
 
LVL 12

Expert Comment

by:pique_tech
ID: 12252419
In the interest of trying the most basic things first:  have you tried using brackets to delimit at least that column:  [client].[client]  to see if that makes the strange behavior stop?
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 12252422
You're using Client as both a table name and field name, which is probably confusing the query compiler.  Rename one of them.

Also, don't have spaces in table, query, and field names.  Spaces mean you have to refer to them with square brackets [ ] in VBA and queries.    

Hope this helps.
-Jim
0
 

Author Comment

by:SandieT04
ID: 12252440
I could have sworn I aliased it and it didn't work !   I think I'm feeling the pressure!!  ;-)  Thanks!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question