Solved

Error in list of function arguments: '=' not recognized. Unable to parse query text

Posted on 2008-10-17
13
3,500 Views
Last Modified: 2012-05-05
When configuring the following query (see below) in a table adabter I get the aformentioned error message.

SELECT col1, col2, IIF(col3 = 's', 'sold', 'not sold') AS AliasColumnName FROM TableName
NOTE: Im using MS Access and designing in VB.Net
0
Comment
Question by:slightstk
[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
  • 5
  • 4
  • 2
  • +2
13 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 100 total points
ID: 22746427
SELECT col1, col2, IIF([col3] = 's', 'sold', 'not sold') AS AliasColumnName FROM TableName

or

SELECT col1, col2, IIF([col3] = "s", "sold", "not sold") AS AliasColumnName FROM TableName
0
 

Author Comment

by:slightstk
ID: 22746457
Experts please try your solutions before you post them.  I have already tried that.
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22746483
You have the error message and then you press ok. The VS add some spaces and then it runs fine, right ?
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22746491
oh, sorry i didn't notice you are using VS..
0
 
LVL 18

Expert Comment

by:jmoss111
ID: 22746497
Hi slightstk,

Do you realize that if your last comment was followed nothing would ever get answered? This site is for help not doing it for you.

Regards,

Jim
0
 
LVL 44

Expert Comment

by:GRayL
ID: 22746509
So make sure col3 is text?
0
 

Author Comment

by:slightstk
ID: 22746518
Ok, fine so I click OK and ignore the err. However I can't get the column to show up on the DataGridView.  I have deleted the BindingSource and created a new one with the same query and I still cant get the AliasColumnName to appear on the  DataGridView.  How Do I get this new column to appear on the dgv?
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22746524
But this has nothing to do with your question! After you press OK the query runs fine.
You have to show code, explain what you have done, etc, etc.
0
 

Author Comment

by:slightstk
ID: 22746530
There is no way to determine if the code runs fine because I don't see the results in the DataGridView.  There is no code to show.  Simply put I have a GDV, bound to a table with the sql query metioned above.  The alias column never shows.  How do I get this column to appera appear on the GDV?
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22746558
But you cannot make changes on the Access Database from the Visual Studio! It doesn't allow you to save.
If you're trying to do the changes there you cannot see the right result.
0
 

Author Comment

by:slightstk
ID: 22746576
Im not trying to make changes to the db.  I am trying to execute the following query:

SELECT col1, col2, IIF(col3 = 's', 'sold', 'not sold') AS AliasColumnName FROM TableName

Display the results in a DataGridView.  However, the column AliasColumnName does not appear there.  How do I get it to appear on the DataGridView?

Guys I know that I bounced around on this question but I belive all these problems are connected.
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 400 total points
ID: 22746594
Ok, seems that you have changed the query on the dataset.
Then in the DataGridView select the "DataGridView Task" (from the top right corner) and choose add colums. Add the column AliasColumnName
0
 

Author Comment

by:slightstk
ID: 22747027
That did it jpaulino. Thanks guys.  
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

729 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