-
Notifications
You must be signed in to change notification settings - Fork 5
Description
So
=gsSQL("select * from booksales where Date > '5/3/2022' ", "booksales", BookSales!A1:H)
is including records with TEXT CHARACTERS in the Date column. My comparisons to mySQL don't have this issue since I only have DATES in that SQL table. However, sheets can have anything - so I would probably think those records should be skipped.
Note This specific example may not be solvable.
When a comparison is to be made and either side of the logical comparison is an instance of Date, both sides are converted to a JS date. So the problem here is that if a column data in 'Date' is character data and '5/3/22' is character data - a regular ASCII comparison would be made. If however, '5/3/2022' references a CELL (bind variables) - it would be taken to be a date since Sheets would automatically converted it into a JS date
e.g. cell C1 was a date.
=gsSQL("select * from booksales where Date > ?1 ", "booksales", BookSales!A1:H, true, C1)