Skip to content

Execute SQL SELECT statements on sheet data. #3

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

demmings
Copy link

=gsSQL( SelectSqlStatement, [TableDefinitions], [ColumnOutputFlag], [BindVariableData])
  • SelectSqlStatement ==> Your SELECT statement.
  • TableDefinitions ==> "table1", range, "table2", range,...
  • ColumnOutputFlag ==> true/false. Include column names in output.
  • BindVariableData ==> As many variable data items that are referenced in SELECT. The first one is replaced in SELECT as ?1. The second one is ?2, and so on...
select * from sales where date > ?1
  • Example:
=gsSQL("select transaction_date, sum(gross), sum(amount)
          from 
             mastertransactions 
          where 
             transaction_date >= ?1 and transaction_date <= ?2 and expense_category in
           (select income from budgetCategories where income <> '') 
           group by 
               transaction_date pivot account", 
           "mastertransactions", 'Master Transactions'!$A$1:$I, "budgetCategories",budgetIncomeCategories,
 true, '01/01/2022', '05/19/2022')

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant