Dim MyQuery As String
Dim rs As ResultSet
MyQuery = $"SELECT Datum, strftime('%w', ('20' || Substr(Datum, 7,2)
||'-'|| Substr(Datum, 4,2)
||'-'|| Substr(Datum, 1,2))) AS dday FROM table1"$
rs=SQL1.ExecQuery(MyQuery)
Do While rs.NextRow
Log(rs.getint("dday")) 'it will show 0, or 1, or 2, etc.
Loop