0

In my excel I have the following text in a cell:

INSERT INTO `educations`(`education_id`, `school`, `specialization`, `date_from`, `date_to`, `user_id`) VALUES (NULL,'NULL','software','2006-01-01 00:00:00','2006-01-01 00:00:00',@inserted_id);

I want to (programmatically) substitute all the 'NULL' and change them to NULL (without the quotes).

I tried using the substitute function but I cannot get it working.

=SUBSTITUTE(DU7;"''NULL''";"NULL")
Dennis
  • 3,044
  • 2
  • 33
  • 52

3 Answers3

2

Try this,

=SUBSTITUTE(DU7;"'NULL'";"NULL")

Not sure why you were repeating the single quote marks.

Malcolm

Gowtham Shiva
  • 3,802
  • 2
  • 11
  • 27
Mal B
  • 84
  • 3
1

Please try this,

Single quote -

=SUBSTITUTE(DU7;"'NULL'";"NULL")

Substituting single quotes is easier, just like how you substitute other strings, But substituting double quotes has to be written similar to how you have did.

Double Quote-

=SUBSTITUTE(DU7;"""NULL""";"NULL")

Gowtham Shiva
  • 3,802
  • 2
  • 11
  • 27
1

Use Find and Replace Function in Excel, Use this

Find What: 'NULL'

Replace With: NULL

Screenshot

Satish Babariya
  • 3,062
  • 1
  • 15
  • 29