sql - Error converting data type nvarchar to bigint - caused by join -


i've found thousands of issues error converting data type nvarchar bigint no solution specific problem. have generic table dynamicarticle_parameterresult value field can contain (numbers / text).

if subqueries based on join (articleresultid = daar.id) 'error converting data type nvarchar bigint':

select        osl.groupname maingroupname, daar.saleslineid, daar.salesid, daar.id, spt.number + 1 subno,   (select        value                                       dynamicarticle_parameterresult dynamicarticle_parameterresult_9                                   (articleresultid = daar.id) , (name = 'panel_dx')) panel_dx,                          (select        value                                       dynamicarticle_parameterresult dynamicarticle_parameterresult_8                                   (articleresultid = daar.id) , (name = 'panel_dy')) panel_dy,                          (select        value                                       dynamicarticle_parameterresult dynamicarticle_parameterresult_7                                   (articleresultid = daar.id) , (name = 'panel_dz')) panel_dz,                           (select        name                                       productmanagerconfig.dbo.colors                                   (id =                                                          (select        top (1) value                                                                       dynamicarticle_parameterresult                                                                   (articleresultid = daar.id) , (name = 'panel_color')))) colorname, osl.groupname soort, st.loadday, st.routenumber, st.routeordernumber, st.salesnumber,                       st.productionnumber, products.groupname, products.fullnamefrom            dynamicarticle_articleresult daar inner join                      productmanager_products products on products.itemid = daar.itemid inner join                      salestable st on st.id = daar.salesid inner join                      ordersaleslines osl on osl.saleslineid = products.saleslineid , osl.depth = 0 inner join                      saleslines sl on sl.id = products.saleslineid inner join                      master.dbo.spt_values spt on spt.type = 'p' , spt.number < sl.quantity        (products.id in (116994,116993)) , (daar.name = 'panel' or                      daar.name = 'klassiekpaneel')  

if put filter right in subquery ((articleresultid in(1075728,1075669)) runs fine?

select        osl.groupname maingroupname, daar.saleslineid, daar.salesid, daar.id, spt.number + 1 subno,   (select        value            dynamicarticle_parameterresult dynamicarticle_parameterresult_9                                   (articleresultid in(1075728,1075669)) , (name = 'panel_dx')) panel_dx,                          (select        value                                       dynamicarticle_parameterresult dynamicarticle_parameterresult_8                                   (articleresultid in(1075728,1075669)) , (name = 'panel_dy')) panel_dy,                          (select        value                                       dynamicarticle_parameterresult dynamicarticle_parameterresult_7                                   (articleresultid in(1075728,1075669)) , (name = 'panel_dz')) panel_dz,                           (select        name                                       productmanagerconfig.dbo.colors                                   (id =                                                          (select        top (1) value                                                                 dynamicarticle_parameterresult                                                                   (articleresultid in(1075728,1075669)) , (name = 'panel_color')))) colorname, osl.groupname soort, st.loadday, st.routenumber, st.routeordernumber, st.salesnumber,                       st.productionnumber, products.groupname, products.fullname            dynamicarticle_articleresult daar inner join                      productmanager_products products on products.itemid = daar.itemid inner join                      salestable st on st.id = daar.salesid inner join                      ordersaleslines osl on osl.saleslineid = products.saleslineid , osl.depth = 0 inner join                      saleslines sl on sl.id = products.saleslineid inner join                      master.dbo.spt_values spt on spt.type = 'p' , spt.number < sl.quantity (products.id in (116994,116993)) , (daar.name = 'panel' or                      daar.name = 'klassiekpaneel')  

is there way prevent converting error?

kind regards,

mike

turned out join ordersaleslines caused problem. although returned 1 row per product. removed , runs fine.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -