Solved

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

Posted on 2008-10-17
13
3,272 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
  • 5
  • 4
  • 2
  • +2
13 Comments
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 100 total points
Comment Utility
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
Comment Utility
Experts please try your solutions before you post them.  I have already tried that.
0
 
LVL 48

Expert Comment

by:jpaulino
Comment Utility
You have the error message and then you press ok. The VS add some spaces and then it runs fine, right ?
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
oh, sorry i didn't notice you are using VS..
0
 
LVL 18

Expert Comment

by:jmoss111
Comment Utility
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
Comment Utility
So make sure col3 is text?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:slightstk
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
That did it jpaulino. Thanks guys.  
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now