Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. USE [Veldheres]
  2. GO
  3. /****** Object: View [dbo].[VI_IM_ITEM_WITH_INV] Script Date: 12/6/2019 3:08:01 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. /* VI_IM_ITEM_WITH_INV */
  9. CREATE view [dbo].[VI_IM_ITEM_WITH_INV] as
  10. select
  11. IM_ITEM.*,
  12. -- Cannot do IM_INV.* because some field names are then repeated (e.g.,
  13. -- ITEM_NO). So we list each field individually.
  14. IM_INV.LOC_ID,
  15. IM_INV.BIN_1,
  16. IM_INV.BIN_2,
  17. IM_INV.BIN_3,
  18. IM_INV.BIN_4,
  19. IM_INV.MIN_QTY,
  20. IM_INV.MAX_QTY,
  21. IM_INV.QTY_COMMIT,
  22. IM_INV.QTY_ON_HND,
  23. IM_INV.QTY_ON_PO,
  24. IM_INV.QTY_ON_BO,
  25. IM_INV.QTY_ON_XFER_OUT,
  26. IM_INV.QTY_ON_XFER_IN,
  27. IM_INV.QTY_AVAIL,
  28. IM_INV.NET_QTY,
  29. IM_INV.LST_AVG_COST,
  30. IM_INV.LST_COST as INV_LST_COST, /* <== Special case since we now have IM_ITEM.LST_COST */
  31. IM_INV.STD_COST,
  32. IM_INV.COST_OF_SLS_PCT,
  33. IM_INV.FST_RECV_DAT,
  34. IM_INV.LST_RECV_DAT as INV_LST_RECV_DAT, /* <== Special case since we now have IM_ITEM.LST_RECV_DAT */
  35. IM_INV.FST_SAL_DAT,
  36. IM_INV.LST_SAL_DAT,
  37. IM_INV.LST_CNT_DAT,
  38. IM_INV.LST_ORD_DAT,
  39. IM_INV.NXT_EXPECTD_DAT,
  40. IM_INV.NXT_EXPECTD_PO,
  41. IM_INV.GL_VAL,
  42. IM_INV.AVG_COST,
  43. IM_INV.QTY_ON_ORD,
  44. IM_INV.QTY_ON_LWY,
  45. IM_INV.QTY_ON_SO,
  46. IM_INV.DROPSHIP_QTY_ON_CUST_ORD,
  47. IM_INV.DROPSHIP_QTY_ON_PO,
  48. IM_INV.ANNL_HLD_COST,
  49. IM_INV.ANNL_HLD_COST_PERC,
  50. IM_INV.EOQ,
  51. IM_INV.EOQ_CALC_ON,
  52. IM_INV.ORD_COST_PER_ORDER,
  53. IM_INV.REORD_PNT,
  54. IM_INV.SFTY_STK,
  55. IM_INV.SRVC_LEVL,
  56. IM_INV.STK_STAT_PER_NET_QTY,
  57. IM_INV.STK_STAT_PER_QTY_AVAIL,
  58. IM_INV.STK_STAT_PER_QTY_ON_HND
  59. from IM_ITEM
  60. join IM_INV
  61. on IM_ITEM.ITEM_NO = IM_INV.ITEM_NO
  62. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement