Hi all,
I'm able to run SQL in Teradata SQL Assistant and getting results.
When I connect via excel and run the query from there, the rest of the query works, but the equal or less than date not.
This is the vba code for hte SQL query:
Code
thisSql = "SELECT TOP 1 BALANCE " & _
"FROM tbl_CUSTOMER_DB " & _
"WHERE ((BRANCH_NO)= " & branch & ") AND ((ACCOUNT_NO)= " & Acc & ") AND ((MVT_DATE) <= " & ToDate & ") Order By MVT_DATE desc "
It totaly ignores the "<=" as the date in the "ToDate" is the 31/08/2016 and in the outcome of the query dates in end of September are in the query results.
(dates are entered in Teradata SQL as text: 20160831)
Any chances this can be fixed?
Greetings