Update query with 'null' value for numeric field

panchitocarioca

Registered User.
Local time
Today, 03:11
Joined
Aug 11, 2008
Messages
11
hi,

i have question and i was hoping you could help me with it. By using an update query i update several fields of several records of a table. The values which the update query uses to fill into the fields of the records are in a form. In some caes the value of the field of records in the table should be updated to 'empty'. In case of a numeric field, when the update query attempts to update the field to 'null' (empty), an error occurs.

by the way, the relevant field does not have a standard value, and it is not a required field. Does anyone know if it is possible to make numeric fields empty through an update query? It should be possible, since you can also manually delete the content of a numeric field in a table.

many thanks in advance for the help.

best regards,
 
Last edited:
Drop the quotes around Null.
 
have tried it with and without quotes, but both do not work. Should it be possible to clear a numeric field that cotains a value, by using an update query?
 
As long as it's not required, sure. Just tested this:

UPDATE TableName SET FieldName = Null
 
I still getting the same error ErrorIncorrect date value: ''NULL'' for column 'DateOfDeath' at row 1

And the quey below :UPDATE celebmaster SET IsActive='y',FullName='21Mar P',FName='21Mar',MName='',LName='P',DOB='1980-1-1',BirthPlace='',DateOfDeath='\'NULL\'',PlaceOfDeath='sdfgdf',CauseOfDeath='dfgd',Height='',Address='',CurrentPartner='',PriviousPartners='',HairColour='',EyeColour='',Specialisation='',Biography='',FanSites='',Agent='',IsFormarCeleb='n' WHERE CelebID='14253'

even tried setting DateOfDeath='' or DateOfDeath=null or DateOfDeath=Null or DateOfDeath='Null' or DateOfDeath= null etc.
But as you people know its a bug in mysql.
So can anybody help me out with this trivia.
 

Users who are viewing this thread

Back
Top Bottom