my code stock.com

senser

V_HST_SUBSCR_SRV_FSC_WEEK_PFL
by senser

V_HST_SUBSCR_SRV_FSC_WEEK_PFL

Snippet options

Download: Download snippet as v_hst_subscr_srv_fsc_week_pfl.txt.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

ALTER VIEW [dbo].[V_HST_SUBSCR_SRV_FSC_WEEK_PFL]
AS
SELECT     
		   COD_SUBSCR_SRV, 
		   COD_SUBSCR_SRV		AS COD_SUBSCR_SRV_PFL,
		   COD_PROD_SRV_TY, 
		   COD_PROD_SRV_TY		AS COD_PROD_SRV_TY_PFL,
		   COD_SRV_PLAN, 
		   COD_SRV_PLAN			AS COD_SRV_PLAN_PFL, 
		   COD_SRV_FAM,
		   COD_SRV_FAM			AS COD_SRV_FAM_PFL,
		   COD_PROD_SRV, 
		   COD_PROD_SRV			AS COD_PROD_SRV_PFL,
		   COD_EQUIP,
		   COD_EQUIP			AS COD_EQUIP_PFL,
		   COD_VEND, 
		   COD_VEND				AS COD_VEND_PFL,
		   COD_SUBSCR, 
		   COD_SUBSCR			AS COD_SUBSCR_PFL,
		   
		   OPR_COD_SRV, 
		   OPR_COD_SRV			AS OPR_COD_SRV_PFL,
		   
           DAT_INI_DW			AS DAT_INI_DW_SRV, 
           DAT_END_DW			AS DAT_END_DW_SRV, 
           DAT_INI_BILL, 
           DAT_END_BILL, 
           DAT_INSTALL			AS DAT_INSTALL_SRV, 
           DAT_CANCEL			AS DAT_CANCEL_SRV,
           
           IND_TLINK, 
           IND_DLINK, 
           IND_KIT,
            
           QTT_SRV				AS QTT_SRV_ACTV, 
           
           COD_USER_CREATED, 
           DAT_USER_CREATED, 
           COD_USER_MODF, 
           DAT_USER_MODF,
            
           VAL_SRV,
           
           B.COD_FSC_WEEK,
           B.COD_FSC_WEEK		AS COD_FSC_WEEK_PFL,
           D.COD_DAY			AS COD_DAY_PFL
           
FROM         DBO.SN_T_HST_SUBSCR_SRV A,
			 DBO.SN_T_LKP_FSC_WEEK   B,
			 DBO.SN_T_LKP_DAY        D
WHERE     
		  A.DAT_INI_BILL <= B.COD_LAST_DAY_FSC_WEEK
AND		  A.DAT_INI_DW <= B.COD_CLOSE_DAY_FSC_WEEK
AND		  (A.DAT_END_DW < 0) OR (A.DAT_END_DW > B.COD_CLOSE_DAY_FSC_WEEK) OR ( (A.DAT_END_DW <= B.COD_CLOSE_DAY_FSC_WEEK) AND (A.DAT_END_BILL > B.COD_LAST_DAY_FSC_WEEK) )
AND		   D.COD_DAY >= A.DAT_PFL_INI AND D.COD_DAY < A.DAT_PFL_END

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.