Rick Ratchford <r...@amazingaccuracy.com> wrote: > Unfortunately, I have to take the examples provided and convert them > into > STRINGS that Visual Basic 6 can use. > > Here is that string from your earlier example: > > sSQL = "SELECT Date, Month, Day, Open, High, Low, Close FROM [" & > gsTableName & "] " & "WHERE ((Month - " & lngStartMth & ")*100 + (Day > - " & > lngStartDay & ") + 1300) % 1300 <= " & lngEndMth - lngStartMth & " * > 100 + " & ((lngEndDay - lngStartDay) + 1300) Mod 1300 & " ORDER BY > ((Month - " & > lngStartMth & ")*100 + (Day - " & lngStartDay & ") + 1300) % 1300"
In the the right-hand side of <= operator, you only apply "mod 1300" to ((lngEndDay - lngStartDay) + 1300) part but not to (lngEndMth - lngStartMth)*100 part. Be careful which calculations you perform in the host language, and which you embed in SQL statement. You have a strange mix of the two. Doesn't your VB SQLite binding support parameterized statements? If so, I'd suggest you dump it and find a better one. Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users