Forum Discussion

slan110's avatar
slan110
Copper Contributor
Aug 25, 2023
Solved

Help with Query Criteria

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: 

 

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

  • I actually able to use a formula like : Between DateAdd("d",-5,[Enter Date]) And [Enter Date] and it worked perfectly!

2 Replies

  • slan110's avatar
    slan110
    Copper Contributor
    I actually able to use a formula like : Between DateAdd("d",-5,[Enter Date]) And [Enter Date] and it worked perfectly!
  • 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.

Resources