Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel SQL Query - Still Cannon Figure It Out (Help!)

Status
Not open for further replies.

jetar

Programmer
Oct 16, 2003
49
US
Ok,

I posted this question a couple of days ago, so here is the background again. I have an asp.net page on which I am displaying some data in a datagrid. The Datasource for the grid is an excel sheet.

I created a range on the sheet so I could treat it like a table for queries, the name of the range is CoreProcessRange. There are only 4 columns.

The column giving me hell is 'core_process'.

There are about 1500 rows in the sheet.

If I do:
'Select core_rocess From coreprocessrange'

Everything works fine

But if I do:
'Select distinct core_process from coreprocessrange'

I get the following error:
'The field is too small to accept the amount of data you are attempting to add. Try inserting or pasting less data'

This Error makes no sense, I have tried doing everything to alter this column to make it work and always with the same results.

All of the other 3 columns have more data than 'core_process' and they also have more distinct values. The thing that differentiates 'core_process' is that for a lot of the rows it has blanks or no data whereas the other columns have data for almost every row.

Either of the above SQL statements work for all the other columns.

I have since given up trying to execute the query from the web page and am now just opening the worksheet in excel and then go to Data -> Import External Data -> New Database Query, and I use the excel sheet as the source. I get the same error there over and over again.

Please help.
 
ASP.NET forum forum855



Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top