I get this error with my custom module, Any advice on tracking down the problem? I get this error when i select an option form a select list.

http://i.stack.imgur.com/ACmDg.png

Drupal Watchdog log Error Details

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'examplesite.field_data_field_for_date' doesn't exist: SELECT r.entity_id AS entity_id FROM {field_data_field_for_date} r WHERE (field_for_date_target_id = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 0 ) in stopsale_getcurrentsale() (line 249 of /nfs/c05/h02/mnt/examplesite.com/html/sites/all/modules/custom_apps/stopsale/stopsale.module).

http://i.stack.imgur.com/ACmDg.png
You need to create a custom field called for_date which will be represented in the database as field_data_field_for_date or remove field_data_field_for_date from the SQL query.