Call Report

  • Thread starter Report Construction
  • Start date
R

Report Construction

Right now I have made a report that diplays all of my customers that I have
contacted and the corresponding notes with each conversation. What type of
formula do I have to use to create a report that will give me all of my
contact for the past two weeks? I want it to automatically update by the
current day, so it does not just shoe me the two weeks of when I designed the
report. Is there an expression that will update the date from day to day?
 
F

fredg

Right now I have made a report that diplays all of my customers that I have
contacted and the corresponding notes with each conversation. What type of
formula do I have to use to create a report that will give me all of my
contact for the past two weeks? I want it to automatically update by the
current day, so it does not just shoe me the two weeks of when I designed the
report. Is there an expression that will update the date from day to day?

The DateField includes just the date, not the date and time?

Create a query that includes all of the fields used in the report.
Base the report upon this query (the Report's Recordsource).
In the query, as criteria on the DateField, write:

Between Date() and DateAdd("ww",-2,Date())

or you could use 14 days instead of 2 weeks:

Between Date() and DateAdd("d",-14,Date())

or you could simply use:

Between Date() and Date()-14
 
D

Duane Hookom

The simple solution is to open the report's Record Source in design view and
enter a criteria under the [ContactDate] field of:
=DateAdd("D",-14,Date())

IMHO a better solution is to have a form with a text box (txtFromDate) with
a default value of =DateAdd("D",-14,Date()). Add a command button to open the
report and change the code to something like:

Dim strWhere as String
strWhere = "1=1 "
If Not IsNull(Me.txtFromDate) Then
strWhere = strWhere & " AND [ContactDate] >=#" & Me.txtFromDate & "# "
End If
DoCmd.OpenReport "rptYourRptName", acPreview, , strWhere
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top