Type conversion failure

sean98

New Member
Joined
Apr 4, 2002
Messages
26
I am trying to update a table using information from the table and I am running into a type coversion failure. My goal is to update those records that are showing a qty sold and quantity return both equal to zero. The field I want updated is the COGS field. It should be equal to a field called EXT_SALES which is the total cost of the sale. The table is set up that the EXT_SALES and COGS fields are both data type "double".

UPDATE SalesResults SET [SalesResults].EXT_SALES_AMT = "COGS"
WHERE ((([SalesResults].OFFRNG_QTY_SLD)=0) AND (([SalesResults].OFFRNG_QTY_RTN)=0))
WITH OWNERACCESS OPTION;

When I run the query using the view button the correct information appears, however when I use the run button is tells me it is about to update the appropriate records after selecting yes it tells me the appropriate records will not be updated because of a type conversion failure. No other reasons impact the records requiring updates.

Any help would be appreciated.

Thanks
This message was edited by sean98 on 2003-02-21 12:31
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Well, I see what your problem is. The way you have your syntax set up, you're trying to actually write the phrase "COGS" into the
EXT_SALES_AMT field. I think this'll work:
UPDATE SalesResults SET [SalesResults].COGS=[SalesResults].ext_sales
WHERE ((([SalesResults].OFFRNG_QTY_SLD)=0) AND (([SalesResults].OFFRNG_QTY_RTN)=0))
WITH OWNERACCESS OPTION;

with this code, you're setting the cogs field equal to the ext_sales field when qty_sold and qty-rtn both equal 0
 
Upvote 0

Forum statistics

Threads
1,221,531
Messages
6,160,359
Members
451,642
Latest member
mirofa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top