I think I almost have it. I am posting my modified workflow below.
The only error I am getting now is: “Execute Query: Conversion failed when converting date and/or time from character string.”
Main.xaml (8.9 KB)
In this version, I am using 2 input dialog activities to get a start date and end date string variable.
Then I am using 2 assign activities to convert these string variables to DateTime variables using the following code: DateTime.ParseExact(startDate,“yyyy-mm-dd”,New system.Globalization.CultureInfo(“en-US”))
AND
DateTime.ParseExact(EndDate,“yyyy-mm-dd”,New system.Globalization.CultureInfo(“en-US”))
Then my execute query activity attempts to dump these 6 transactions from the list into a new table called “testDummy2”.
This code works when I manually type the dates in:
Blockquote
INSERT INTO ArgoPro.dbo.TestDummy2
SELECT testDummy.[Month_Number], testDummy.[Month], testDummy.[Year],
testDummy.[Employee], testDummy.[Manager], testDummy.[Company], testDummy.[Division],
testDummy.[Department], testDummy.[Report_Date], testDummy.[Last_Submitted_Date],
testDummy.[Delegate], testDummy.[Report_Name], testDummy.[Purpose], testDummy.[City_Location],
testDummy.[Expense_Type], testDummy.[Account_Code], testDummy.[Transaction_Date], testDummy.[Vendor],
testDummy.[Entry_Key], testDummy.[Payment_Type], testDummy.[Personal], testDummy.[Expense_Amount]
FROM ArgoPro.dbo.testDummy
WHERE Transaction_Date Between ‘2018-11-15’ AND ‘2019-01-01’
Blockquote
How can I replace the two dates in the Where statement above with dynamic variables in the execute query activity?
@Palaniyappan @sandeep13 @Ishmeet_Bindra