Solved

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

Posted on 2008-10-17
13
3,355 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 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

816 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

9 Experts available now in Live!

Get 1:1 Help Now