You will likely need to utilize SSJS via the Rows.Retrieve function.
Sample script:
var yourDE = DataExtension.Init("yourDE");
var complexfilter = {
LeftOperand:{
Property:"Date",
SimpleOperator:"greaterThan",
Value: {{Start Date}}
},
LogicalOperator:"AND",
RightOperand:{
Property:"Date",
SimpleOperator:"lessThan",
Value: {{End Date}}
}};
var filterdata = yourDE.Rows.Retrieve(complexfilter);
Be aware though, this will only allow a maximum return of 2500 rows for each retrieve.
To get around this, you will need to do 1 of two things.
- Utilize SOAP API to do this Retrieve Request and then use ContinueRequest property.
Sample Continue Request in SSJS:
do {
//your Retrieve Request API here
rr.ContinueRequest = requestId;
} while (runstatus == "MoreDataAvailable")
- Create a Query in SFMC and run it prior to each pull and then utilize the resulting DE as a reference for your AMPscript - I would include an attribute named 'Secret' with a value of 1 - for easy reference in your lookup.
Sample SQL:
SELECT Column1, Column2, 1 as Secret
FROM yourDE
WHERE Date >= '2017/02/25' and Date <= '2017/12/07'