Skip to content

Date comparison not valid when NON DATE characters are in column. #58

@demmings

Description

@demmings

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions