0

What's wrong with my SQL update? I'm trying to update records with the upcoming value for status records with the value as missed & due_date BETWEEN 2020-08-01 AND 2020-12-31.

Where is the Syntax error?

UPDATE
  records
SET
  status = upcoming,
WHERE
  status = ‘ missed ’ & due_date BETWEEN 2020 -08 -01
  AND  2020 -12 -31 ;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
Tim
  • 13
  • 4

1 Answers1

1

I think this should be written as:

UPDATE records
   SET status = 'upcoming'
   WHERE status = 'missed' AND
         due_date BETWEEN '2020-08-01' AND  '2020-12-31';

Notes:

  • Strings should be in single quotes.
  • Dates should be in single quotes.
  • SQL uses AND not & for boolean AND.
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786