Solved

Weird Column Name

Posted on 2004-10-07
5
782 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
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now