date parameter similar to access in SQL Server -


I am working on a query that we are expanding into MS Access with another simple query. REQUIREMENTS_DATE & lt; Now () - ([M: 56 T: 57 W: 58 Th: 59 F: 60]) Where I have the REQUIREMENTS_DATE & lt; Gateet (60) access query below allows the person to enter the report to enter the number of days given on that day of the week, but as of now, let me manually The code has to be changed which is not a big deal for me, but I can export a user like Excel and execute a user with some SQL knowledge. Is there something in SQL Server that is in the function used in access, so that my user can enter the value and has been reported for that date:

  SELECT P.PLANT_CODE, P.STOCK_CATEGORY, P.MATERIAL, P.DISTRIBUTION_VERSION_CODE, P.PERIOD_CODE, p. REQUIREMENTS_DATE, p. PPLANNED_QTY AS 'REM Plan QT', p. VERSION_IND_FLAG, P.S.I.S..S..S.JLLLL, p. Withdrawal_Centity, P.technical_index, pplnadit + p. Withdrawal_quentity AS 'Original FCST Volume' in PW ('6040', '6041') P.PLANT_CODE and ('A60385000', 'A60385003' in '00') and P.DISTRIBUTION_VERSION_CODE, '01' in P. STOCK_CATEGORY, 'ZU', 'Z2') and p. REQUIREMENTS_DATE & lt; Try it running:  
  @number integer set @number as the case declares when DATENAME (DW, GETDATE ()) = 'Monday', then 56 when DATENAME (DW, GETDATE ()) = 'Tuesday again 57 when DATENAME (DW, GETDATE ()) = 'Wednesday' and 58 as dates (dw, GETDATE ()) = '' Thursday, the 59 date when (dw, GETDATE ()) = 'Friday the 60 END; Select P.PLANT_CODE, p. STOCK_CATEGORY, P.MATERIAL, P.DISTRIBUTION_VERSION_CODE, P.PERIOD_CODE, p. REQUIREMENTS_DATE, P.PLANNED_QTY AS 'REM Plan QT', p. VERSION_IND_FLAG, P.S.I.S..S.JLLLL, p. Vithdra WT, Pikteknikl_aiandiaks, p .PLANNED_QTY + P.WITHDRAWN_QUANTITY as 'original FCST volume from VW_PLANNED_REQMNTS_TXT P WHERE P.PLANT_CODE IN (' 6040 ',' 6041 ') and P.STOCK_CATEGORY IN (' A60385000 ',' A60385003 ') and P.DISTRIBUTION_VERSION_CODE IN (' 00 ',' 01 ',' ZU ',' Z2 ') and p. REQUIREMENTS_DATE & lt; GETDATE () - @ number and P.PLANNED_QTY;  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -