Error converting data type nvarchar to numeric 'witholding tax' (OWHT)
Hi Guys.
After I have upgraded my clients 2007 PL 30 database to 8.81 PL05, and running a repair to fix inconsistincies, I am receiveing some error when opening any sales documents.
It takes place when I open a sales document, or browse previous docs. When browsing previous docs, it onlly happens on some of them.
I also receive a different error when viewing sales orders: Error converting data type nvarchar to numeric (CRD2).
Any ideas how to fix it?
It does not limit me from processing and using the rest of the functionality. All calculations with queries in the docs are still working.
Thanks.
Hi,
Please check Note No. : 1402855 and see if the same applied to the issue mentioned by you.
Kind Regards,
Jitin
SAP Business One Forum Team
Similar Messages
-
Im getting an error when running a procedure that includes this code.
I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql
DECLARE @retval AS DECIMAL(12,2)
DECLARE @MonthVal VARCHAR(20), @SpreadKeyVal INT
DECLARE @sqlcmd AS NVARCHAR(150)
DECLARE @paramdef NVARCHAR(150)
SET @MonthVal = 'Month' + CAST(@MonthNumber AS VARCHAR(2) );
SET @SpreadKeyVal = @SpreadKey; --CAST(@SpreadKey AS VARCHAR(10) );
SET @sqlcmd = N' SELECT @retvalout = @MonthVal FROM dbo.CourseSpread WHERE CourseSpreadId = @SpreadKeyVal';
SET @paramdef = N'@MonthVal VARCHAR(20), @SpreadKeyVal INT, @retvalout DECIMAL(12,2) OUTPUT'
--default
SET @retval = 0.0;
EXECUTE sys.sp_executesql @sqlcmd,@paramdef, @MonthVal = 'Month4',@SpreadKeyVal = 1, @retvalout = @retval OUTPUT;
SELECT @retval
DECLARE @return_value DECIMAL(12,2)
EXEC @return_value = [dbo].[GetSpreadValueByMonthNumber]
@SpreadKey = 1,
@MonthNumber = 4
SELECT 'Return Value' = @return_value
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for:
https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
>> I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql <<
This is so very, very wrong! A column is an attribute of an entity. The idea that you are so screwed up that you have no idea if you want
the shoe size, the phone number or something else at run time of this entity.
In Software Engineering we have a principle called cohesion that says a model should do one and only one task, have one and only one entry point, and one and only one exit point.
Hey, on a scale from 1 to 10, what color is your favorite letter of the alphabet? Yes, your mindset is that level of sillyity and absurdity.
Do you know that SQL is a declarative language? This family of languages does not use local variables!
Now think about “month_val” and what it means. A month is a temporal unit of measurement, so this is as silly as saying “liter_val” in your code. Why did you use “sp_” on a procedure? It has special meaning in T-SQL.
Think about how silly this is:
SET @month_val = 'Month' + CAST(@month_nbr AS VARCHAR(2));
We do not do display formatting in a query. This is a violation of at the tiered architecture principle. We have a presentation layer. But more than that, the INTERVAL temporal data type is a {year-month} and never just a month. This is fundamental.
We need to see the DDL so we can re-write this mess. Want to fix it or not?
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Error converting data type varchar to numeric - maybe non printable character?
Hello all. I'm having some trouble converting a column in my table from varchar(50) to decimal(20,4). I've also tried to convert it to int and had no luck. In trying to find the records with non numeric data, I ran this query...
SELECT *
FROM [table]
WHERE [column] not like '%[^0-9]%'
My result set was 32 rows where the field in question had zeros. This doesn't make sense to me. If it was a real zero, it would have been excluded from the query.
So, I flipped it around and ran the following query, and got the same results.
SELECT *
FROM [table]
WHERE [column] = '0'
If it's really a string 0, what would keep it from converting to a numeric type? I'm wondering if there are non printable characters in there because this table was populated via SSIS package using a flat file.
Thanks for any help you can provide!
WeeLassI have discovered one of the values that will not convert. It is '-1.2317 ' and I tried RTRIM and those trailing spaces stay there.
It has a length of 8, and ASCII value of 45, and converting to varbinary gives 0x2D312E3233313709.
The 45 and 2D both point to a negative sign. This one does indeed have a negative sign, but it's in the front, not trailing. Also, another value that was failing was not negative, but did have the trailing spaces.
Any ideas on how to figure out what those spaces actually are? Hopefully, if I know that, then I can know how to get rid of them.
WeeLass
It may be a hard space
RTRIM trims only soft spaces
try this and see if works
REPLACE(ColumnName,CHAR(160),'')
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Crystal Data Conversion Issue (Error converting data type varchar to datetime)
Hi,
I can run stored procedure without error in SQL Server using my personal credentials as well as database credentials.
I can also run Crystal Report after connecting to Stored procedure without error on my desktop using my personal credentials as well as database credentials.
But when I upload the crystal report in BOBJDEV and when I run using database credentials report fails saying that "Error in File ~tmp1d1480b8e70fd90.rpt: Unable to connect: incorrect log on parameters. Details: [Database Vendor Code: 18456 ]" but I can run the crystal report successfully on BOBJDEV using my personal credentials.
I googled (Data Conversion Error Message) about this issue & lot of people asked to do "Verify Database" in Crystal Report. So I did that, but when I do it I am getting a error message like this:
Error converting data type varchar to datetime.
Where do you think the error might be occurring? Did anyone faced this kind of issue before? If so, how to resolve it?
(FYI, I am using Crystal Reports 2008, & for stored procedure I have used SSMS 2012 )
Please help me with this issue.
Thanks & Regards.
Naveen.hello Naveen,
since the report works fine in the cr designer / desktop, we need to figure out where you should post this question.
by bobjdev do you mean businessobjects enterprise or crystal reports server? if so please post this question to the bi platform space.
-jamie -
CF9, no hotfix, VendorErrorCode 8114, cfprocresult error converting data type
Hello, everyone.
I've got an issue that really has me scratching my head. Not sure where the issue lies, but I'll explain as best I can.
Basically, I _think_ I'm being told that one of the fields in the recordset is not being converted.
On one page, I make the following CFINVOKE:
<cfinvoke component="components.header" method="content_single" returnvariable="resultset"
dbdsn="#request.db_dsn#" dbusr="#request.db_username#" dbpwd="#request.db_password#">
<cfinvokeargument name="table" value="#url.table#">
<cfif isDefined("url.thisNav") AND len(trim(url.thisNav)) gt 0><cfinvokeargument name="pt" value="#trim(url.thisNav)#"></cfif>
<cfif isDefined("url.id") AND val(url.id) gt 0><cfinvokeargument name="id" value="#val(url.id)#"></cfif>
<cfif isDefined("url.section") AND len(trim(url.section)) gt 0><cfinvokeargument name="section" value="#trim(url.section)#"></cfif>
</cfinvoke>
Within a CFCOMPONENT in header.cfc, I have the following:
<cffunction name="content_single" access="public">
<cfargument name="dbdsn" required="yes">
<cfargument name="dbusr" required="yes">
<cfargument name="dbpwd" required="yes">
<cfargument name="pt" required="no">
<cfargument name="id" required="no">
<cfargument name="section" required="no">
<cfargument name="table" required="yes">
<cfstoredproc procedure="SRT_sp_#lcase(url.table)#_contents_single" datasource="#dbdsn#"
username="#dbusr#" password="#dbpwd#"
result="query_result">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" variable="@table" value="#lcase(table)#" maxlength="30">
<cfif isDefined("pt") AND len(trim(pt)) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" variable="@pt" value="#ucase(pt)#" maxlength="12" null="no"></cfif>
<cfif isDefined("id") AND val(id) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" variable="@id" value="#val(id)#" maxlength="10" null="no"></cfif>
<cfif isDefined("section") AND len(trim(section)) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" variable="@section" value="#trim(replace(lcase(section),'_',' ','all'))#" maxlength="20" null="no"></cfif>
<cfprocresult name="returned_result">
</cfstoredproc>
<cfreturn returned_result>
</cffunction>
Instead of the results I expect, I get the following error:
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Error converting data type varchar to int.
The error occurred in E:\xxxxxxxx\xxxxxxx\xxxx\components\header.cfc: line 17
Called from E:\xxxxxxxx\xxxxxxx\xxxx\content_view.cfm: line 24
Called from E:\xxxxxxxx\xxxxxxx\xxxx\components\header.cfc: line 17
Called from E:\xxxxxxxx\xxxxxxx\xxxx\content_view.cfm: line 24
15 : <cfif isDefined("id") AND val(id) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" variable="@id" value="#val(id)#" maxlength="10" null="no"></cfif>
16 : <cfif isDefined("section") AND len(trim(section)) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" variable="@section" value="#trim(replace(lcase(section),'_',' ','all'))#" maxlength="20" null="no"></cfif>
17 : <cfprocresult name="returned_result">
18 : </cfstoredproc>
19 : <cfreturn returned_result>DBVARNAME is obsolete: don't use it. You must pass-in the parameters positionally, not by name. And, accordingly, you need to pass all of them in (with null values, if necessary).
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d 52.html:
{quote}
Changed the dbvarname attribute behavior: it is now ignored for all drivers
{quote}
Adam -
Error converting data when updating table
Hi,
I need to understand why I cannot gat my update to work properly, I have to concat 4 fields (numbers with leading zeros so I can create a new number with leading 1. My field is already set as a bigint but I cannot convert the resulting string properly
UPDATE table
set field = convert(bigint, '1', strfield1 + strfield2 + strfield3 + strfield4)
1, 001
+ 0125 + 0045 + 004568
The end result need to return the number 100101250045004568 to be inserted into a bigint field but I always get the following error:
Error converting data type nvarchar to bigint
If I try a select , it shows the proper result, so what am I missing hereGuess I will have to wait for our new SQLServer 2012, coming in next week, I have tried every possible cast, convert possibility to make it work.
Thank you all
Al
This should work fro SQL Server 2008 R2
select CAST(('1'+ strfield1 + strfield2 + strfield3 +strfield4) AS BIGINT);
web: www.ronnierahman.com -
Does data type nvarchar in SQL 7.0 have matched DATA TYPE in JAVA
does data type nvarchar in SQL 7.0 have matched DATA TYPE in JAVA
I use odbc-jdbc bridge to connect to SQL 7.0
thanks in advance!try String.
java.sql.Types.VARCHAR would be the sql type. -
Data error (invalid data type 17) in a Remote Function Call
Hi,
I am passing 2 select-option tables to RFC.
Tables have structures -
Table1 SIGN(C1)
OPTION(C2)
HIGH(C6)
LOW(C6)
Table2 SIGN(C1)
OPTION(C2)
HIGH(C20)
LOW(C20)
At the destination side, I have created two table types which have same structure.
But when I call the RFC , program terminates with error - "Data error (invalid data type 17) in a Remote Function Call"
Not able to understand the reason for this error. Please help.
Thanks,
SujeetHi,
check out this example
[LINK|http://abap.googlar.eu/viewtopic.php?f=5&t=28]
You have several ranges that you can use like RANGE_AUF.
Function example:
FUNCTION zexemple.
*"*"Interface local:
*" IMPORTING
*" REFERENCE(R_HORA) TYPE FLAG
*" REFERENCE(R_DIA_1) TYPE FLAG
*" REFERENCE(P_IDOC) TYPE FLAG
*" EXPORTING
*" REFERENCE(MSG) TYPE CHAR255
*" TABLES
*" T_OIFSPBL STRUCTURE OIFSPBL
*" SL_PBLNR STRUCTURE RANGE_PBLNR
*" SL_MATNR STRUCTURE RANGE_MATNR
*" SL_HORA STRUCTURE RANGE_UZEIT
*" T_ERROS STRUCTURE ZARSTRING
ENDFUNCTION.
Report:
SELECT-OPTIONS: sl_pblnr FOR oirbpblb-pblnr,
sl_matnr FOR a361-matnr.
~
Final question:
You are passing the values using TABLES and not IMPORTING right? -
Problem with converting data types
Hi Experts,
I am stuck up with a little problem, i need your help
i am converting all the data types to CHAR but i am not getting the expected data out.........
My code is as below...where do i go wrong...
LOOP AT <T_ITAB> ASSIGNING <FIELD>.
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE <FIELD> TO <RECORD>.
IF SY-SUBRC = 0.
LV_FIELD = <RECORD>.
N = STRLEN( LV_FIELD ).
IF N = '8'.
IF LV_FIELD IS NOT INITIAL.
LV_DATE = LV_FIELD.
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = LV_DATE
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC EQ 0.
CONCATENATE LV_FIELD+6(2) LV_FIELD+4(2) LV_FIELD+0(4) INTO LV_FIELD SEPARATED BY '.'.
ENDIF.
ENDIF.
ENDIF.
IF LV_RECORD IS INITIAL.
LV_RECORD = LV_FIELD.
ELSE.
CONCATENATE LV_RECORD LV_FIELD INTO LV_RECORD SEPARATED BY ' * '.
ENDIF.
ELSE.
EXIT." DO
ENDIF.
ENDDO.
APPEND LV_RECORD TO LT_OUTPUT.
CLEAR LV_RECORD.
ENDLOOP.
THE TABLE LT_OUTPUT LIKE THENV(CHAR 255)
My output looks some thing like this:
04 36876 15.09.2011 39600 1999
06 36960 15.09.2011 39600 2632
07 36874 15.09.2011 39541 9232
My expected output
04 36.876 15.09.2011 39.600 1.999
06 36.960 15.09.2011 39.600 2.632
07 36.874 15.09.2011 39.541 9.232
Regards
samAt run time you can see all the data........ like what i have shown...
but if you clearly see, DATE will be in the internal format..but if you print it, it will be in dd:mm:yyyy
can you suggest me if i have a dynamic field symbol (table data) ,,,, How can i convert data types dynamically..
if it is a static internal table i am achieving with WRITE TO statement.....but i have huge data in field symbols...
Instead of all these , please specify the exact problem your are facing . What is it with date field ? . In SAP while printing the internal format will be converted to external. What is your requirement with this date field?
My output looks some thing like this:
04 36876 15.09.2011 39600 1999
06 36960 15.09.2011 39600 2632
07 36874 15.09.2011 39541 9232
My expected output
04 36.876 15.09.2011 39.600 1.999
06 36.960 15.09.2011 39.600 2.632
07 36.874 15.09.2011 39.541 9.232
I dont see any problems mentioned in your date field. Both your actual and expected outputs reflects the same in date field.
In SCN you will only get solutions if your question is precise.
Kesav -
How to convert data type while using @variable function
Hi Gurus,
I have a query.
i have created a Derived Table and the statement is given below.
select 1 as SENSITIVITY_LEVEL,1 as SUBSENSITIVITY,@variable('US_T') as NITEMS, ...........
here in @variable('US_T') "US_T" is hard coded value. I want to change to data type of hard coded value as numeric or integer
i am using sap BI 4.0 universe design tool.
Thanks in Advance.
Regards,
JeetHi Jeet,
Since it is text you can't convert into number.
Can you please let mw know the exact requriement of yours?
why you need this
Thanks,
Swapnil -
Error changing data type to date in column containing blanks
I am pulling data from an OLAP cube into PowerPivot. My data set contains several date columns wich are formatted as YYYY-MM-DD string values. After successfully importing the data, I am trying to set the data type of these columns to date.
Apparently, when the column contains blank values, the conversion fails:
The following system error occurred: Type mismatch. Datatype conversion failed for [Table: 'SO fact table', Column: 'Shipping Date LastDateDate', Value: ''].
When the column contains no blanks, the conversion succeeds.
Would anyone have an idea for working around this issue ?
Is there some MDX magic that I could use in my query in order to cast blank dates to something that PowerPivot would accept to convert, or to make the conversion to the date format right at the source ?Hello,
I did a quick test with data from Excel sheet formatted as text containing ISO date values with one blank value, in Power Pivot I then changed it to type "Date" and it works without an issue; so it must have an other reason:
You can try to use the
DAX function "DateValue" to convert the values
Olaf Helper
[ Blog] [ Xing] [ MVP] -
I have a JSP to read the date value and use it to update the corresponding column in the table. In the JSP, the data type returned from request.getParameter("hiredate") is java.util.Date. Unfortunately, the CachedRowSet requires the java.sql.Date type. How can I convert the java.util.Date type to java.sql.Date type? Please advise,thanks.
SKSK,
This is how I do it:
java.util.Date utilDate = new java.util.Date();
long millis = utilDate.getTime();
java.sql.Date sqlDate = new java.sql.Date(millis);Good Luck,
Avi. -
As per the Java Complete Reference Book, long Data Types Range is -9223372036854775808 to 9223372036854775807.
Ex. long l = 9223372036854775807;
I got an error message while compiling this above statement.The Error message is : "integer number too large: 922337203685477580"
Why the above error is coming?type
long l = 9223372036854775807L; -
I want to transfore forms date directly to report. then i use run_report_object function. But in forms i use datetime type replace of default date type. then the item can show time. then i revoke the report.rep-1340 error get. Who have better solution. thanks a lot.
Hi ...
pass thedate by a parameter list
but transform the date into char
with to_chat(the_date,format)
in report's query you will may do like this:
select ..... where query_date = to_date(the_parameter,format);
the formats must be the same.
Good look !
Ovidiu ANCUTA
[email protected] -
Convert Data type from Oracle Data time string to SQL Date time data type
I have a time stamp column pulled from oracle into a SQL server db table varchar datatype column.
Now i want to change that column to date time.
Following is the data present in the table:
01-APR-11 02.15.00.026000 AM -08:00
01-APR-11 04.15.00.399000 AM -08:00
01-APR-11 06.15.00.039000 AM -08:00
I want to convert this data into sql server datetime data type.
Please advice.
Thanks,
Sam.
I am unable to find the solution in other sites which is why I have posted it in Oracle forum for seeking solution.
Thanks in Advance.
Sam.Sam,
How are you actually loading the data into SQL*Server - are you using something like an Oracle gateway, BCP or another Microsoft utility of some sort ?
If you are using an Oracle problem then we may be able to help but if using a Microsoft utility then you should really follow up with Microsoft to know what format the data should be in to use a Microsoft utility.
Regards,
Mike
Maybe you are looking for
-
My new ipod touch's Battery life is extremely short
I bought 10 days ago the latest iPod touch and it is getting very poor battery life. Even without using multitasking and with having notifications turned off, it is running from full to empty in less than two hours. What is it that I have to do betwe
-
Im using BAPI_INB_DELIVERY_CHANGE instead of BDC to update the DATABASE
can any help me in using BAPI_INB_DELIVERY_CHANGE ..i got stuck with it....
-
Hello, i have a prob creating connection pool via AS "wizard" i've tried both com.ibm.as400.access.AS400JDBCDataSource and com.ibm.as400.access.AS400JDBCDriver both doesnt work for me... i have the following parameters: <property name="hibernate.conn
-
Highlight a Row in Master Region
I have two regions Master Region, which has few rows. Secondly there is another region Details Region which displays the details of the selected row in the master region. 2 Questions: 1) I made it work in APEX 3.2 but the whole page refreshes, How ca
-
when i use my camera of my iPhone this one cant open , is block . i cant do picture the screen stay closed ( black )