# Database Discussions > Microsoft SQL Server 2008 >  CHARINDEX not working

## BenJ

charindex help.jpg

Anyone able to tell me why CHARINDEX(':',MVSLIB,35) is not working?

----------


## rmiao

What do you mean 'not working'? Did you get any error?

----------


## BenJ

> What do you mean 'not working'? Did you get any error?


Yes, the error message is in the screenshot showing the statement and the error?

----------


## rmiao

Didn't see query there. Did you try with t-sql in query window and post query/error?

----------


## BenJ

> Didn't see query there. Did you try with t-sql in query window and post query/error?


Sorry I'm new to SQL talk. I usually get the I.T guys to create me the report in Crystal Reports and exract me the SQL statement to use in Excel Microsoft Query.

What exactly do you mean by t-sql in query window?

----------


## rmiao

Did you run query against sql table? Is it sql server related issue?

----------


## BenJ

> Did you run query against sql table? Is it sql server related issue?


I do this:

Microsoft Excel
Data
From Other Sources
From Microsoft Query
Choose the database
Login
Choose the tables & columns
Output it to a table in Excel

Than I edit it via the query editor or direct edit the command SQL statement

----------


## rmiao

This is sql server forum, you should post the issue in excel forum.

----------


## BenJ

> This is sql server forum, you should post the issue in excel forum.


So you can't see any problem with the SQL statement? 

I'm just using Excel to output to a table the data  retrieved by the SQL statement, so it's not really an Excel issue? It's SQL language?

----------


## rmiao

It doesn't sound sql issue, should post it to excel forum.

----------

