Sunday, October 16, 2022

SQL

Table 2 includes a field EXPLOSIVES which is either 1 or blank.

SELECT Table2.[month], Table2.[date], Table2.[year], dead, explosives

FROM Table2

where dead > 20 and EXPLOSIVES=1;

complains Enter parameter explosives.  What does it want?

SELECT Table2.[month], Table2.[date], Table2.[year], dead, explosives

FROM Table2

where dead > 20;

works fine. 

7 comments:

  1. Is it case sensitive for the column names?

    Also is the column INT or CHAR?

    ReplyDelete
  2. Is it case-sensitive? I.e. "explosives"" =/= "EXPLOSIVES".

    ReplyDelete
  3. What's the data type of the EXPLOSIVES attribute?

    ReplyDelete
  4. Try 'Explosives IS NOT NULL'. Comparing to a null value causes problems

    ReplyDelete