Skip to Content
author's profile photo Former Member
Former Member

Decimales en Query Manager

Hola estimados,

Actualmente estoy realizando un query que me arroje el saldo de inventarios de cierta cantidad de articulos. Como mantenemos un stock variado en el cuales tenemos productos que se venden por unidad y tambien tenemos productos que se venden por libras, necesito saber como condicionar cuando estos primeros sean elegidos y no arrojar el stock con decimales, pero si son elegidos los que se venden por libras, si deben ir, si es el caso, los decimales.

Adjunto el query que elabore,

Select T0.[ItemCode],



From OITM T0

inner join OITW T1 on T0.[ItemCode] = T1.[ItemCode]

and T1.[WhsCode] = 'ALM-P'


T0.[ItemCode] between [%0] and [%1]

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Oct 21, 2015 at 08:53 AM


    yo probaría y ajustaría esta consulta a tus necesidades:

    SELECT T0.itemcode, T0.itemname,T0.[SUoMEntry], CASE T0.[SUoMEntry] WHEN 1 THEN substring(CAST(T1.onhand AS NVARCHAR(20)), 1, charindex('.', CAST(T1.onhand AS NVARCHAR(20)),0)-1) WHEN 2 THEN CAST (T1.OnHand AS NVARCHAR(20)) END FROM OITM T0 INNER JOIN OITW T1 ON T0.[ItemCode] = T1.[ItemCode] INNER JOIN ITM12 T2 ON T0.[ItemCode] = T2.[ItemCode]

    Un saludo

    Agustín Marcos Cividanes

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.