• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

MDB does not recognize xyz as a valid field name or expression

On running a query today, there is an age bucket [>180 days] that is blank, the below query is now returning the above error and when my excel vba trys to refresh the table, it errors out

How can i get this query to lock in >180 days and return 0 if there are no >180 day values

SELECT [S7b - Show Shared Services by Age Bucket Count].Group, [S7b - Show Shared Services by Age Bucket Count].[0 - 7 days], [S7b - Show Shared Services by Age Bucket Count].[8 - 30 days], [S7b - Show Shared Services by Age Bucket Count].[31 - 180 days], [S7b - Show Shared Services by Age Bucket Count].[> 180 days] AS Expr1
FROM [S7b - Show Shared Services by Age Bucket Count];

Thanks
0
Seamus2626
Asked:
Seamus2626
  • 4
  • 3
  • 2
  • +1
1 Solution
 
hnasrCommented:
What do you have, test data, and expected result?
Explain more, and upload file if shortens the talking.
0
 
mbizupCommented:
Try renaming that field to GT180Days, or something else without the > sign.
0
 
Seamus2626Author Commented:
Cant upload the Mdb, its too large

Below is a screenshot of the query and the field expression

Thanks
TEST.docx
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
mbizupCommented:
Your field and table names all could use a little help.

General recommendations are to avoid spaces and special characters in your naming conventions, but I think that the > operator specifically might be making this choke.

As an aside, we also had a user here yesterday whose query was erring because field alias names were too long.  I'm not sure what the exact cutoff is for field, table or alias names... just something to keep in mind, though.

Anyhow, go back to that table or spreadsheet and try renaming that > 180 days column to something that adheres to standard/recommended naming conventions  (GT180Days, GreaterThan180Days, etc.)
0
 
Seamus2626Author Commented:
The problem is that the >180 days field is not in the table S7b - if you look there is no field >180 days, thats what is causing it to fail.

I dont want to remove the field >180 days in case there is data there tomorrow, is it possible to have an IF statement saying if >180 days not in S7b return 0, other wise return value?

Thanks
0
 
als315Commented:
I do not see field .[> 180 days] in your source table/query:
fields
0
 
als315Commented:
Sorry, window was not refreshed.
You can't add missing fields to query. You can add empty field with name > 180:0
0
 
Seamus2626Author Commented:
Hi als,

Yep, this is the problem i need to get around!

Tomorrow they may be a field >180 days, i need the query to return 0 if there is no field and the value if there is a field.

An iff statement?!
0
 
Seamus2626Author Commented:
legend!

Just what i needed!

Just to confirm if there is an entry as 5 tomorrow, it will return 5?

Thanks
0
 
als315Commented:
What is "5 tomorrow" - :text field?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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