Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show records where difference in Date is 30 days

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
Can I create a query the will show only the records whose StartDate and EndDate are greater than 30 days appart.<br>What is the parameter I key in the QBE grid.<br>Or do I need a Function<br><br>I know I can write code, &quot;Everyone&quot; Knows DougP can write code.<br>Can I do it by just using a query and or function.<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you.
 
Put this in the <i>field:</i> row, in a new column in the query grid...<br><br>DateDifference:[EndDate]-[StartDate]<br><br>Then in the <i>Criteria</i> row, put in <i>&gt;30</i> <p>Jim Conrad<br><a href=mailto:jconrad3@visteon.com>jconrad3@visteon.com</a><br><a href= > </a><br>
 
Nope<br>I get #Error<br><br>I wrote a VBA function instead. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you.
 
DougP, if you don't mind me asking, what did the code look like for that. I am trying to create a report where I show results for a user defined time frame, as well as the same time frame a year prior. Any help would be appreciated.
 
DateDiff(&quot;d&quot;,[endDate],[startdate]) then enter in criteria
 
Expr1: DateDiff(&quot;d&quot;,[Date1],Date2]) works for me too!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top