Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 898
  • Last Modified:

Access Query Issue-Not a vild alias name

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
aplona
Asked:
aplona
  • 3
  • 2
  • 2
  • +3
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
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
 
aplonaAuthor Commented:
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
 
David L. HansenProgrammer AnalystCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
jerryb30Commented:
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
 
Rey Obrero (Capricorn1)Commented:
try eliminating suspected columns or
build your query using small number of fields, save then continue until you get the error
0
 
David L. HansenProgrammer AnalystCommented:
Do your last couple of lines actually look like this:

And [To

Date]));
0
 
mbizupCommented:
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
 
aplonaAuthor Commented:
I got it, To many characters in the alias.  Thanks though, appreciate the quick response.
0
 
aplonaAuthor Commented:
I've requested that this question be deleted for the following reason:

To many characters in alias
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Recommend accept on the author's comment, and refund points.
0
 
mbizupCommented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now