Re: Using expression in Query to limit table date used.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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]


.



Relevant Pages

  • Re: Using expression in Query to limit table date used.
    ... >I am trying to identify an expression that I can use in a query to limit ... Each line of monthly data has a unique number ... An Autonumber field by itself won't help: ... to retrieve the past three months' records. ...
    (microsoft.public.access.queries)
  • Using expression in Query to limit table date used.
    ... I am trying to identify an expression that I can use in a query to limit ... is an autonumber field. ... Each line of monthly data has a unique number ... Prev by Date: ...
    (microsoft.public.access.queries)
  • Re: Stock Quotes in Excel 2008
    ... In the help and support file "How to create Web query files on page 3 there ... If I have 10 stocks in my portfolio Excel sheet, do I have to write 1 query ... There are several sample queries in the Queries folder in the Office ...
    (microsoft.public.mac.office.excel)
  • Re: more dimensional method like a query...
    ... > First i have stocks, ... If the stocks live in a SQL RDBMS, you should attempt to meet the ... If it's a collection in memory, the simplest thing is to iterate ... document and use an implementation of XQuery to query the collection, ...
    (comp.object)
  • Re: Stock Quotes in Excel 2008
    ... In the help and support file "How to create Web query files on page 3 there ... If I have 10 stocks in my portfolio Excel sheet, do I have to write 1 query ...
    (microsoft.public.mac.office.excel)