Solved

Weird Column Name

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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