A
Azzna
Hello,
I am importing data from an outside source into my database. Before we
can work with the data, I have to do a series of updates to said data
and then insert the data into an existing table. So, I have this
"import" table I work with to manipulate the data before inserting. As
I do my updates to manipulate the table, Desc15 which starts as a
combination of text and numeric ends up with values of only numeric. I
don't want to change the data type of the field during this conversion.
I am trying to use the CAST option to evaluate the numbers there as
numbers, but I am getting a syntax error missing operator on it and I
can't seem to find a reason why. If you all could take a look and let
me know I would appreciate it. I am use to Oracle SQL coding, and
there are just enough differences to mess me up sometimes.
Here is my code:
UPDATE Import SET Import.ArtGrp = IIf(CAST(Desc15 AS
NUMBER)<201,Desc15, IIf(CAST(Desc15 AS
NUMBER)<1000,Right(Desc15,2),IIf(CAST(Desc15 AS
NUMBER)>999,Right(Desc15,3),Null)));
I am importing data from an outside source into my database. Before we
can work with the data, I have to do a series of updates to said data
and then insert the data into an existing table. So, I have this
"import" table I work with to manipulate the data before inserting. As
I do my updates to manipulate the table, Desc15 which starts as a
combination of text and numeric ends up with values of only numeric. I
don't want to change the data type of the field during this conversion.
I am trying to use the CAST option to evaluate the numbers there as
numbers, but I am getting a syntax error missing operator on it and I
can't seem to find a reason why. If you all could take a look and let
me know I would appreciate it. I am use to Oracle SQL coding, and
there are just enough differences to mess me up sometimes.
Here is my code:
UPDATE Import SET Import.ArtGrp = IIf(CAST(Desc15 AS
NUMBER)<201,Desc15, IIf(CAST(Desc15 AS
NUMBER)<1000,Right(Desc15,2),IIf(CAST(Desc15 AS
NUMBER)>999,Right(Desc15,3),Null)));