Nov 16 2022 10:46 AM
Hi,
A consultant wrote the following script, which I took and put in a batch file, calling the script through sqlcmd. I want to take the "hardcoded dates" in the script and change to allow the user to input the dates(they will vary from day to day). Can someone assist me in the best way to handle this?
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP (5000) [FORM]
,[MT]
,[VB]
,[VF]
,[VCH]
,[PT]
,[GCH]
,[GCO]
,[GT]
,[GPCH]
,[GPCO]
,[GPT]
,[FDATE]
,[OPERATOR]
,[CUSTOMER]
,[FUTURE1]
,[FUTURE2]
,[FUTURE3]
,[FUTURE4]
,[FUTURE5]
,[FUTURE6]
,[PMPOP]
,[PMPCRTNO]
,[A_SPEED]
,[AFLW]
,[AFLWT]
,[ATMP]
,[ADNSTY]
,[ACAP]
,[TPMPNO]
,[T_SPEED]
,[TFLW]
,[TFLWT]
,[TTMP]
,[TDNSTY]
,[TCAP]
,[TLOTNO]
,[TTLFLW]
,[TGTRATIO]
,[ACTFLWRATIO]
FROM [NXO].[dbo].[SMC01_DATA] where fdate > '11/15/2022' and fdate < '11/16/2022' order by FDATE asc
go