SOLVED

Help with Query Criteria

Copper Contributor

Hello! 

I have a query where users are entering two dates [Enter Start Transaction Date] and [Enter End Transaction Date]. I am trying to create a subquery that will use [Enter Start Transaction Date] and look back 5 days to capture anything in that timeframe. 

I'm trying this (unsuccessfully): Between [Enter Start Transaction Date]-5 And [Enter Start Transaction Date]

Have also tried this: Between ([Enter Start Transaction Date]-5) And [Enter Start Transaction Date]

This is the error I get: 

slan110_0-1692967418574.png

 

Is this even possible? And if so, how can I achieve this? Thank you!

2 Replies
See if it improves if
[Enter Start Transaction Date]
is a Parameter of type DateTime in your query. While in query design view, find the Parameters form on the Ribbon.
best response confirmed by slan110 (Copper Contributor)
Solution
I actually able to use a formula like : Between DateAdd("d",-5,[Enter Date]) And [Enter Date] and it worked perfectly!
1 best response

Accepted Solutions
best response confirmed by slan110 (Copper Contributor)
Solution
I actually able to use a formula like : Between DateAdd("d",-5,[Enter Date]) And [Enter Date] and it worked perfectly!

View solution in original post