Skip to Content

Whse lock report

Hi Experts,

I am updating OITW through DTW as locked.

I need report for same as how much data i have updated & how much is rest.

SELECT T0.[ItemCode], T0.[ItemName], T1.[WhsCode], T1.[Locked] FROM OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode

Above query returns data in vertical way but i need in horizontal.

i.e. ItemCode, WhsCode1, Locked, Whscode2, Locked, Whscode3, Locked

Awaiting for reply.

Regards,

Ravi

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on May 03, 2011 at 12:26 PM

    Hi Ravi.......

    No of Colums in this reports depends on No. of Warehouses.

    So can you please let me know the No. of Warehouses you are having in your DB?

    Regards,

    Rahul

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on May 03, 2011 at 12:41 PM

    Hi Ravi,

    How many warehouses do you have? If not too many, you can have query like this:

    SELECT T0.ItemCode,

    T0.ItemName,

    (SELECT Locked FROM OITW WHERE ItemCode = T0.ItemCode AND WhsCode = 'Whs01') AS 'WHS01',

    (SELECT Locked FROM OITW WHERE ItemCode = T0.ItemCode AND WhsCode = 'Whs02') AS 'WHS02'

    FROM OITM T0

    Thanks,

    Gordon

    Add comment
    10|10000 characters needed characters exceeded