Re: Using expression in Query to limit table date used.
- From: "Ed Hawley" <hawl1039@xxxxxxxxxxxxxx>
- Date: Tue, 15 Nov 2005 23:13:02 -0500
John, I do have a date field but it won't work very well. What I have are
periods of data. I buy several stocks, hold them for four weeks then sell
them. I do one buy and sell each month so these become my periods. Each
month is a period and has a unique number assigned by the autonumber field.
I would like to view the last 3 periods, the last 6 periods, etc. to monitor
the performance of my stock portfolio. Maybe this information will help. I
would like to use something like "Last period -3 (this would give me the
last 3 months.) or "Last Period -6( to get the last 6 months. I appreciate
your recommendations.
Thanks!
Ed
"John Vinson" <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:vu0jn1dqam8v8p3q9jdrciha66pvvtnteh@xxxxxxxxxx
> On Tue, 15 Nov 2005 00:12:19 -0500, "Ed Hawley"
> <hawl1039@xxxxxxxxxxxxxx> wrote:
>
>>Could use some ideas!
>>
>>I am trying to identify an expression that I can use in a query to limit
>>lines used from a data table. For example, I have data collected over
>>several months. I want to select the data from the last 3 months, the last
>>6
>>months, etc. I would appreciate any ideas that I can try. The key I am
>>using
>>is an autonumber field. Each line of monthly data has a unique number
>>assigned if that helps.
>
> An Autonumber field by itself won't help: from what you say, it's
> impossible to tell if there might be 90 records entered during the
> past three months, or 9, or 9,000,000.
>
> Do you have a Date/Time field in the table which indicates when the
> record was entered or collected? If so, you can use a Query with a
> criterion such as
>
> BETWEEN DateAdd("m", -3, Date()) AND Date()
>
> to retrieve the past three months' records.
>
> If you don't have such a date field, it is pretty much impossible
> unless there is some other information within the record to categorize
> it. What is the structure of your table? What is a "line of monthly
> data"?
>
> John W. Vinson[MVP]
.
- Follow-Ups:
- Re: Using expression in Query to limit table date used.
- From: John Vinson
- Re: Using expression in Query to limit table date used.
- References:
- Using expression in Query to limit table date used.
- From: Ed Hawley
- Re: Using expression in Query to limit table date used.
- From: John Vinson
- Using expression in Query to limit table date used.
- Prev by Date: Re: Update/Append AND Delete combination?
- Next by Date: Adding a table to an Access Form or Report
- Previous by thread: Re: Using expression in Query to limit table date used.
- Next by thread: Re: Using expression in Query to limit table date used.
- Index(es):
Relevant Pages
|