Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access Query Issue-Not a vild alias name

Posted on 2013-01-17
11
Medium Priority
?
824 Views
Last Modified: 2013-01-21
When i try to save this query it gives an error of not a valid alias name.  Here it is:

SELECT
 dbo_calls.checkbox06 as [OC_CAll],
 dbo_calls.unduplicated AS Unduplicated,
 dbo_contacts.entered AS [Enterd Date],
 dbo_contacts.sex As Gender,
 dbo_contacts.birthday AS [Birth Date],
 dbo_contacts.popup01 AS [Marital Status],
 dbo_contacts.popup02 AS [Living Situation],
 dbo_contacts.race,
 dbo_contacts.checkbox01 AS [Arab American],
 dbo_contacts.checkbox02 AS [Latino/Hispanic],
 dbo_contacts.popup06 AS [Primary Language],
 dbo_calls.popup04 AS [Referral Source],
 dbo_contacts.checkbox03 AS [Medicare A & B],
 dbo_contacts.checkbox04 AS [Medicare A Only],
 dbo_contacts.checkbox05 AS [Medicare B Only],
 dbo_contacts.checkbox07 AS [Medicare Part D],
 dbo_contacts.checkbox06 AS [Medicare C-Advantage],
 dbo_contacts.checkbox15 AS [Supplemental Medicare-Medigap],
 dbo_contacts.checkbox32 AS [Medicaid Full],
 dbo_contacts.checkbox10 AS [Medicaid-Spend Down],
 dbo_contacts.checkbox16 AS [Veterans],
 dbo_contacts.checkbox12 AS [Social Security Disability],
 dbo_contacts.checkbox13 AS [Private Health Insurance],
 dbo_contacts.checkbox14 AS [Private Health Insurance],
 dbo_contacts.checkbox17 AS [Workers Compensation],
 dbo_contacts.checkbox18 AS [None],
 dbo_contacts.text02 AS [Other Insurance],
 dbo_contacts.popup15 As [Veteran Status],
 dbo_calls.popup07 AS [Caregiver Status],
 dbo_contacts.volunteer_id AS [Assisting Contact],
 dbo_contacts.number AS [Specialist Assisting Contact],
 dbo_calls.popup03 AS [Trigger],
 dbo_calls.popup09 AS [Primary Helper (ph) Yes/No],
 dbo_calls.popup10 AS [Primary Helper Relationship To Person Needing Services],
 dbo_calls.popup06 AS [PH Lives With Person Needing Services],
 dbo_calls.text07 AS [Hours Of Informal Care And Active Monitoring],
 dbo_calls.popup08 AS [Lacks Memory Or Cognitive Skills For Daily Decision Making],
 dbo_calls.checkbox28 AS [Housework],
 dbo_calls.checkbox29 AS [Taking Medications],
 dbo_calls.checkbox30 AS [Managing Money],
 dbo_calls.checkbox31 As Shopping,
 dbo_calls.checkbox32 AS [Using Telephone],
 dbo_calls.checkbox33 AS Transportation,
 dbo_calls.checkbox23 AS Bathing,
 dbo_calls.checkbox24 AS Dressing,
 dbo_calls.checkbox25 AS [Incontinence Care],
 dbo_calls.checkbox26 AS Transferring,
 dbo_calls.checkbox27 As Ambulation,
 dbo_contacts.checkbox28 AS [Below $2000],
 dbo_contacts.checkbox30 AS [Greater Than $2000],
 dbo_contacts.checkbox11 AS [Below Poverty Less Than $930],
 dbo_contacts.checkbox24 AS [Above Pverty Up To $2094],
 dbo_contacts.checkbox25 AS [Guidelines Less Than $3300],
 dbo_contacts.checkbox26 AS [More Than $3300],
 dbo_contacts.popup03 AS [Residential Living Status At Time],
 dbo_calls.call_date AS [Date Status Set To OC/CLP OR CAse Opened],
 dbo_calls.date01 AS [Date Plan Developed/revised],
 dbo_calls.volunteer_id AS [Counselor Name],
 dbo_calls.popup13 As [Date Shared For Evaluation Purposes],
 dbo_calls.call_time,
 dbo_calls.followup_due_by AS [Follow Up Expected Date],
 dbo_calls.popup12 AS [Person Receiving OC Refuses All Follw-up],
 dbo_calls.checkbox16 AS [Skilled Nursing Care],
 dbo_calls.checkbox18 AS [Private Pay Services],
 dbo_calls.checkbox19 AS [Waiver],
 dbo_calls.checkbox20 AS [program],
 dbo_calls.checkbox21 AS [Adult Home Help],
 dbo_calls.checkbox22 AS [Veteran Services],
 dbo_calls.followup_assigned_to AS [Staff Member Making Follow Up]
FROM dbo_contacts INNER JOIN dbo_calls ON dbo_contacts.[contact_id] = dbo_calls.[call_id]
WHERE (((dbo_calls.checkbox06)=True) AND ((dbo_contacts.entered) Between [From Date] And [To

Date]));
0
Comment
Question by:aplona
[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
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38787786
For starters, it's not best practice to put spaces or any punctuation other than underscore as a table or column name, as it forces you to surround it in square brackets [ ] in SQL.

Everything else looks ok at first glance, as I don't see any Access reserved words being used.

> dbo_contacts.entered AS [Enterd Date],
Typo, probably should be [Entered Date]
0
 
LVL 3

Author Comment

by:aplona
ID: 38787810
Still same error,  The only reason im using the AS and brackets is becasue thats how i want to come out on the spreadsheet when i export it.
0
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 38787822
Some of the names have slash marks (like: [Date Status Set To OC/CLP OR CAse Opened]) and others have dollar signs.  My bet is that even though those characters are accepted, it's choking on them now....just a guess.
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 26

Expert Comment

by:jerryb30
ID: 38787835
In design mode, is any particular field highlighted?

can you post an empty database?

See this as regards special characters:
http://support.microsoft.com/kb/826763
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38787840
try eliminating suspected columns or
build your query using small number of fields, save then continue until you get the error
0
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 38787842
Do your last couple of lines actually look like this:

And [To

Date]));
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38787850
Just backing up the first two comments (no points wanted)

The easiest way to test that and to switch to good naming conventions (No special characters) is to start with a more manageable query with just a couple of fields,

rename them without the punctuation...
Test your query ...
Add a couple more fields without special characters in the Aliases...
test...
etc...
0
 
LVL 3

Accepted Solution

by:
aplona earned 1000 total points
ID: 38787909
I got it, To many characters in the alias.  Thanks though, appreciate the quick response.
0
 
LVL 3

Author Comment

by:aplona
ID: 38788103
I've requested that this question be deleted for the following reason:

To many characters in alias
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38788104
Recommend accept on the author's comment, and refund points.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38788133
Agreed... that's good information for others in similar predicaments.

aplona,

Jim's 'objection' cancelled the deletion.  You can click the "Accept as Solution" button under your own comment (at http:#a38787909 )
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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

730 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