Solved

Access Query Issue-Not a vild alias name

Posted on 2013-01-17
11
646 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
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 65

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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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 250 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 65

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
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…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

820 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