recursive query

  • i have the below script, but it tells me

    Types don't match between the anchor and the recursive part in column "QtyPer" of recursive query "CTE".

    can anyone advise what could be wrong ? QtyPer is of type decimal

    with CTE as (

    select * from BOMTable

    where [Level] = 1

    union all

    select a.TopLevel, a.Level, a.Assembly, a.Component, a.QtyPer *b.QtyPer, a.Route

    from BOMTable a

    inner join CTE b on a.TopLevel = b.TopLevel and a.Assembly = b.Component

    )

    select * from CTE where TopLevel ='20500068'

  • ok folks, i got it

    i needed to simply declare the qtyper type as a high enough decimal value!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply