VBA Command text connecting to ms access

rambans21

New Member
Joined
Nov 12, 2018
Messages
3
Hi Im trying run the below code that is connected to a ms access database... if i run the code based on any criteria apart from date it seems to work, however every time I use date as a criteria it fails with error 1004 "Application-defined or object-defined error"


CommandText = Array( _
"SELECT Consolidated.ID, Consolidated.Type, Consolidated.Tier, Consolidated.Brand, Consolidated.`Start Date`, Consol" _
, _
"idated.`End Date`, Consolidated.Description, Consolidated.`Customer Specific`" & Chr(13) & "" & Chr(10) & "FROM Consolidated Consolidated" & Chr(13) & "" & Chr(10) & "WHERE (Consolidated.`Start Date`>='{ts '2019-01-01 00:00:00'}')" _
)


Thanks
 

Some videos you may like

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Watch MrExcel Video

Forum statistics

Threads
1,118,876
Messages
5,574,765
Members
412,617
Latest member
mlharris
Top