![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. |
#3
| |||
| |||
|
|
sparks wrote: We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. what are you talking about? update tablename set fieldname = null where fieldname<0 I just tested it to be sure and it works fine. |
#4
| |||
| |||
|
|
sparks wrote: We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. what are you talking about? update tablename set fieldname = null where fieldname<0 I just tested it to be sure and it works fine. |
#5
| |||
| |||
|
|
just tried this UPDATE table1 SET q1 = null WHERE [q1]<=0; you tried to assign the Null value to a variable tht is not a Variant data type. On Thu, 27 Oct 2011 09:56:09 -0400, "Bob Barrows" reb01501 (AT) NOyahooSPAM (DOT) com> wrote: sparks wrote: We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. what are you talking about? update tablename set fieldname = null where fieldname<0 I just tested it to be sure and it works fine. |
#6
| |||
| |||
|
|
just tried this UPDATE table1 SET q1 = null WHERE [q1]<=0; you tried to assign the Null value to a variable tht is not a Variant data type. On Thu, 27 Oct 2011 09:56:09 -0400, "Bob Barrows" reb01501 (AT) NOyahooSPAM (DOT) com> wrote: sparks wrote: We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. what are you talking about? update tablename set fieldname = null where fieldname<0 I just tested it to be sure and it works fine. |
#7
| |||
| |||
|
|
this is just too weird. I can not update the values in the table. BUT I can copy the table into a new table and then run the same update query and it works. What, or Why would it do this? On Fri, 28 Oct 2011 07:18:49 -0500, sparks <sparks (AT) home (DOT) com> wrote: just tried this UPDATE table1 SET q1 = null WHERE [q1]<=0; you tried to assign the Null value to a variable tht is not a Variant data type. On Thu, 27 Oct 2011 09:56:09 -0400, "Bob Barrows" reb01501 (AT) NOyahooSPAM (DOT) com> wrote: sparks wrote: We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. what are you talking about? update tablename set fieldname = null where fieldname<0 I just tested it to be sure and it works fine. |
#8
| |||
| |||
|
|
Just a guess: were reserved keywords used for any of the table or field names? Here is a list: http://support.microsoft.com/kb/321266 sparks wrote: this is just too weird. I can not update the values in the table. BUT I can copy the table into a new table and then run the same update query and it works. What, or Why would it do this? On Fri, 28 Oct 2011 07:18:49 -0500, sparks <sparks (AT) home (DOT) com> wrote: just tried this UPDATE table1 SET q1 = null WHERE [q1]<=0; you tried to assign the Null value to a variable tht is not a Variant data type. On Thu, 27 Oct 2011 09:56:09 -0400, "Bob Barrows" reb01501 (AT) NOyahooSPAM (DOT) com> wrote: sparks wrote: We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. what are you talking about? update tablename set fieldname = null where fieldname<0 I just tested it to be sure and it works fine. |
#9
| |||
| |||
|
|
no they used ID and Q1 thru Q97 I asked the guy more about what and why this was done and did get one bit of information. He decided to identify thse fields when they could not do anything with the data. I asked what he was saying He said all variables were set to required YES so they put a value in all the data so it could be imported. But they are not set to required...yea we changed that later. I don't know maybe that is what is happening. the variables were set to required at some point. overall I gave them 2 querys ...one is a make table query to create and copy the data and the other sets the negative values to null. can that be done in one query...dont' know much about make table queries On Fri, 28 Oct 2011 12:09:39 -0400, "Bob Barrows" reb01501 (AT) NOSPAMyahoo (DOT) com> wrote: Just a guess: were reserved keywords used for any of the table or field names? Here is a list: http://support.microsoft.com/kb/321266 sparks wrote: this is just too weird. I can not update the values in the table. BUT I can copy the table into a new table and then run the same update query and it works. What, or Why would it do this? On Fri, 28 Oct 2011 07:18:49 -0500, sparks <sparks (AT) home (DOT) com> wrote: just tried this UPDATE table1 SET q1 = null WHERE [q1]<=0; you tried to assign the Null value to a variable tht is not a Variant data type. On Thu, 27 Oct 2011 09:56:09 -0400, "Bob Barrows" reb01501 (AT) NOyahooSPAM (DOT) com> wrote: sparks wrote: We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. what are you talking about? update tablename set fieldname = null where fieldname<0 I just tested it to be sure and it works fine. |
#10
| |||
| |||
|
|
this is just too weird. I can not update the values in the table. BUT I can copy the table into a new table and then run the same update query and it works. What, or Why would it do this? On Fri, 28 Oct 2011 07:18:49 -0500, sparks <sparks (AT) home (DOT) com> wrote: just tried this UPDATE table1 SET q1 = null WHERE [q1]<=0; you tried to assign the Null value to a variable tht is not a Variant data type. On Thu, 27 Oct 2011 09:56:09 -0400, "Bob Barrows" reb01501 (AT) NOyahooSPAM (DOT) com> wrote: sparks wrote: We had a guy here make determinations on a table(s) and replaced missing values with numbers. something like if missing -9, unsure -3, etc so now they have several tables with junk in them. how can I replace all of these new values he put in with null in number fields. I know if a query it will say you cant replace with null because variable is not a variant. I just need to replace all values <0 with null in the tables. what are you talking about? update tablename set fieldname = null where fieldname<0 I just tested it to be sure and it works fine. |
![]() |
| Thread Tools | |
| Display Modes | |
| |