Solved

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

Posted on 2008-10-17
13
3,439 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

749 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