title: postgresql/pgAdmin - accepting start_date & end_date arguments as input on query run
body: <p>This is a postgresql db I'm working with using pgAdmin.</p>
  <p>Forgive me if this is somewhat common knowledge, I'm new to postgresql in particular... and I didn't find any direct answers through prior searching.</p>
  <p>I'm wondering if there's a simple way to implement start_time/end_time arguments as inputs when the query runs using pgadmin and any of it's built in features.</p>
  <p>The data type I'm working with here is &quot;timestamp with timezone&quot;.</p>
  <p>Looking for some direction on the best way to implement this.</p>
  <p>I considered declaring start_time and end_time as variables, then using WHERE to filter based on those, but without 3rd party/application level solutions, is there a way to prompt for input when the query runs inside of pgadmin?</p>
  <p>I appreciate any suggestions- here's my attempt at getting something working, but it errors out: query has no destination for result data.</p>
  <pre><code>do $$
  DECLARE
      start_date timestamp := '2020-10-1';
      end_date timestamp := '2020-10-5';
  begin
  
  select distinct on (account.id, menu.name, kitchen_item.name)
  account.id as &quot;Account ID&quot;,
  account.firstname as &quot;Seller First Name&quot;, 
  account.lastname as &quot;Seller Last Name&quot;,
  account.email as &quot;Seller Email&quot;,
  account.phone as &quot;Seller Phone&quot;,
  address.address as &quot;Seller Address (Street)&quot;,
  address.address_2 as &quot;Seller Address 2&quot;,
  account.zip_code as &quot;Seller Zip&quot;,
  address.neighborhood as &quot;Seller Neighborhood&quot;,
  menu.name as &quot;Name of active menu&quot;,
  kitchen_item.name as &quot;Dishes&quot;, 
  kitchen_item.price as &quot;Price&quot;,
  kitchen_item.daily_max_orders as &quot;Quantity&quot;,
  menu.pickup_start_time as &quot;Start time&quot;, 
  menu.pickup_end_time as &quot;End time&quot;,
  menu.repeat_mon as &quot;Monday&quot;,
  menu.repeat_tues as &quot;Tuesday&quot;,
  menu.repeat_wed as &quot;Wednesday&quot;,
  menu.repeat_thurs as &quot;Thursday&quot;,
  menu.repeat_fri as &quot;Friday&quot;,
  menu.repeat_sat as &quot;Saturday&quot;, 
  menu.repeat_sun as &quot;Sunday&quot;,
  order_item.created as &quot;Date of last sale&quot;
  from account
  left join store on account.id = store.account_id
  left join menu on store.id = menu.store_id
  left join menu_item on menu.id = menu_item.menu_id
  left join kitchen_item on (menu_item.kitchen_item_id = kitchen_item.id and store.id = kitchen_item.store_id)
  left join orders on (orders.store_id = store.id)
  left join order_item on (order_item.order_id = orders.id)
  join store_address on store.id = store_address.store_id
  join address on store_address.address_id = address.id
  where orders.placed BETWEEN start_date AND end_date
  order by account.id asc, menu.name, kitchen_item.name asc, order_item.created desc;
  
  end $$;
  </code></pre>