Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jmodiba
Starting Member
7 Posts |
Posted - 2008-11-25 : 06:58:19
|
hi this script is being on my production environment for a while since yesterday it bomb out with following error can anyone help please Msg 8114, Level 16, State 5, Line 1Error converting data type varchar to bigint.this error is as result of this statement which is part of the whole statementandconvert(bigint,ct.Reference6) = 1SELECTct.ID,convert(smalldatetime, substring(ct.Reference10,0,11), 120) as Reference10,ltrim(rtrim(ct.Details)) as Details,ct.Amount,cb.AccountIDFROMCashBookTransaction ctinner joinCashBookBatch cb on ct.CashBookBatchID = cb.IDinner joinAccount a on cb.AccountID = a.IDWHEREa.DomainID = @CurrentDomainIDandct.CashbookTransactionTypeID = 1andconvert(bigint,ct.Reference6) = 1andisnumeric(ct.reference6) = 1and Reference5 = '-1'andct.ReconID is nullORDER BY 2,3,4,5 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-11-25 : 07:01:19
|
SELECT * FROM CashBookTransaction WHERE ISNUMERIC(reference6) = 0too see which varchar values cannot be translated into a numeric value, regardless of truncation or rounding. E 12°55'05.63"N 56°04'39.26" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-25 : 07:23:51
|
orSELECT * FROM CashBookTransaction WHERE reference6 like '%[^0-9]%'MadhivananFailing to plan is Planning to fail |
|
|
|
|
|
|
|