Solved

Weird Column Name

Posted on 2004-10-07
5
775 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I could have sworn I aliased it and it didn't work !   I think I'm feeling the pressure!!  ;-)  Thanks!!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 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

11 Experts available now in Live!

Get 1:1 Help Now