Excel SQL data type mismatch

Gregor Grimschitz

I have this query

SELECT * 
FROM [RawData$] 
WHERE 'Temperature[°C]' <= 100  

But at the execution I get this error:

Data type mismatch in criteria expression.

The data in this column is 100% integer so I guess there is no problem.

Further this works fine:

SELECT * 
FROM [RawData$] 
WHERE 'Temperature[°C]'

I also tried this too but then I get no values at all:

SELECT * 
FROM [RawData$] 
WHERE 'Temperature[°C]' <= '100'

Actually the final question would be:

What query do i need to search a column which name is: Temperature[°C]

[Temperature[°C]]
[Temperature[[]°C]]

do not work.

Martin Dreher

This WHERE 'Temperature[°C]' <= 100 compares the literal string Temperature[°C] to the Integer 100.

Use WHERE [Temperature(°C)] < 100 instead.

Note:

  • square brackets [] are reserved to be wrapped around fieldnames (much like you tried to use single quotes ')
  • in this particular case, the square brackets in your header get interpreted as normal brackets ().

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related