I want to execute query from WinCC SCADA via VBA script. It's simple query, when I execute it on the MS Management Studio - it works well but when i create it in VBA script - it doesn't.
sZapytanie = sZapytanie & " WHERE Data >= '"
sZapytanie = sZapytanie & datastart & "'"
The resulting query is
SELECT * FROM ArchiwizacjaDanych WHERE Data >= '2017-12-16'
This query without "WHERE" statements works well. What is wrong?
The output query from MsgBox is in the picture.
on the phone right now
make sure you replace "-" with "" or with "0" if day or month <10