Skip to content

Tag: oledb

Data type for SQL aggregate functions (COUNT, SUM, AVG)

New to SQL. Say I run this query: This will return a single row with a field called “TotalSuppliers”. In my database, the result was “778”. When tested in C# using typeof, the type for this field was short (the ODBC SMALLINT or OleDB SmallInt data type). This matched the data type of t…

Sql string with OLEDB gives error 1004 in VBA

I would like to import a text file into excel filtering just what I want through a VBA macro. When I use LIKE operator in the sql string I get the error 1004. I have tried both * and % as wildcard and ALike instead of Like but there is no difference. test_7.txt and the macro is: Answer SQL statements