I'm writing a SQL query in Excel VBA but it returns blank column (doesn't read the value)
Query - Select Distinct [Column1] from [TableName]
There are 29k rows in the [Column1], out of which Row #48 has some value and all other are null (Blank). The code above returns only null (Blank) value. However i Tested some cases and following are my observations -
1.If I copy the value from Row #48 and move to Row #1 (deleting the original value at Row#48), the query works
If I add some other values in the column, the query works and sometimes it doesn't depending on which Rows I add the Value in
I've checked the Range of [TableName], it covers the required columns and Rows
- The query works fine on columns which have multiple values
- Tried changing format of the cells but didn't help
Appreciate it if someone could tell me why is this happening and How should i go ahead Correcting this.