Date Calculations

  • Thread starter Thread starter John Castle
  • Start date Start date
J

John Castle

Can anyone help me with this please?

I want to enter a date via a parameter dialob box and for
it to return a list of records that have dates less than
the date I entered + 1 week. I have tried <([Enter Date]
+8 to no avail. Once I have fixed this I then want to
have a 2nd list that lists dates between the above
criteria and 1 month ahead ie something like Between
([Enter Date]+8)and ([Enter date])+ 1 month)
 
Try putting this in the Criteria of your query

1) >DateAdd("d",8,[Enter Date])

2) Between DateAdd("d",8,[Enter Date]) and DateAdd("m",1,[Enter Date])

HTH
 
Try using the DateAdd Function. Access may not be correctly resolving your
parameter type and may be doing some arithmetic on your Date entry. One other
method would be to declare your parameters -

DateAdd("d",8,[Enter Date])

Between DateAdd("d",-7,[Enter Date]) And DateAdd("m",1,[Enter Date])

or perhaps you mean
Between DateAdd("d",-7,[Enter Date]) And DateAdd("m",1,DateAdd("d",-7,[Enter Date]))
 
If you want to do anything except get straightforward parameters, I
believe that it is better to create a Form for the user to enter the
basic information from which you are deriving your parameters, with
hidden calculated fields for the derived values. You can then have as
many of these as you like and make calculating them as complicated as
you like. The form must be left open (usually hidden) while the query
runs and the relevant fields on it are referred to like
[Forms]![frmMyParamForm]![txtMyTextBox].

Can anyone help me with this please?

I want to enter a date via a parameter dialob box and for
it to return a list of records that have dates less than
the date I entered + 1 week. I have tried <([Enter Date]
+8 to no avail. Once I have fixed this I then want to
have a 2nd list that lists dates between the above
criteria and 1 month ahead ie something like Between
([Enter Date]+8)and ([Enter date])+ 1 month)


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Back
Top