Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 21st, 2010, 05:13 PM
Registered User
 
Join Date: Feb 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access running summary data

I have a serial data based on Date (per day) Mon to Fri. Its easy to derive an average for the whole data but I want a running average of the past twenty days, ten days etc
Grateful for your help on how to do this
Thanks
Makace
Reply With Quote
  #2 (permalink)  
Old March 2nd, 2010, 03:08 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Do you mean like "SELECT * FROM MyData WHERE Date BETWEEN etc?" or select top 20? How are you displaying this data (form or report?) What events are triggering the view?

Do you have sample table columns and a query that works?
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #3 (permalink)  
Old March 2nd, 2010, 03:53 PM
Registered User
 
Join Date: Feb 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access running summary

mmcdonal,
Below is sample data for my query. I want to display a running display of the latest 20, 10, 5, days (records) of the Dhigh and DLow in either a report or query that is grouped from top down (if possible display in vertical graphic pattern)

Thanks for your help
Makace

Day DHigh DLow
Thur 1.41 1.40
Fri 1.42 1.41
Mon 1.42 1.42
Tue 1.42 1.40
Wed 1.41 1.40
Thur 1.41 1.39
Fri 1.40 1.39
Mon 1.39 1.39
Tue 1.40 1.39
Wed 1.40 1.39
Thur 1.39 1.37
Fri 1.37 1.36
Mon 1.37 1.36
Tue 1.38 1.37
Wed 1.38 1.37
Thur 1.38 1.36
Fri 1.37 1.35
Mon 1.36 1.36
Tue 1.38 1.36
Wed 1.38 1.36
Thur 1.37 1.35
Fri 1.36 1.35
Mon 1.37 1.36
Tue 1.37 1.35
Wed 1.36 1.35
Thur 1.36 1.35
Fri 1.37 1.35
Mon 1.37 1.35
Reply With Quote
  #4 (permalink)  
Old March 3rd, 2010, 08:34 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi again,

I created a table like this:

Table1
DataID = PK
DayWeek = Text
DHigh = Single
DLow = Single

Is that what you are working with? If so, I created this query to display the data for the last 5 days. I assumed that the records are created in order since there are no Date fields in your data. Therefore, I am using the PK to sort the data, like this:

Code:
SELECT TOP 5 Table1.DataID, Table1.DayWeek, Table1.DHigh, Table1.DLow
FROM Table1
ORDER BY Table1.DataID DESC;
So this data:

Table1
DataID DayWeekDHigh DLow
1 Mon 1.1 1
2 Tues 2.1 1.1
3 Weds 3.1 2.2
4 Thurs 2.5 1.8
5 Fri 2 1.75
6 Mon 2 1.4
7 Weds 1.8 1.2
8 Thurs 1.8 1.2
9 Fri 1.9 1.1

yields these results:

DataID DayWeek DHigh DLow
9 Fri 1.9 1.1
8 Thurs 1.8 1.2
7 Weds 1.8 1.2
6 Mon 2 1.4
5 Fri 2 1.75

Does that work for you? If there were dates associated with these days, the results would be more reliable.
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #5 (permalink)  
Old March 3rd, 2010, 09:48 AM
Registered User
 
Join Date: Feb 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access running summary

Hi mmcdonal'
Thanks for trying to help with my query. I have dates for the data, see below. What I want to achieve is a report or query in 'access' which selects the latest 20 or 10 etc days of the combined DHigh and DLow and arrange them in one column of descending order. Please note there are 3 colums - Date, DHigh, DLow eg the first line has date 01-Feb-10, DHigh 1.3939, DLow 1.3853

Thank you

Makace


Date DHigh DLow
01-Feb-10 1.3939 1.3853
02-Feb-10 1.3975 1.3886
03-Feb-10 1.4026 1.3886
04-Feb-10 1.3903 1.3713
05-Feb-10 1.3746 1.3585
08-Feb-10 1.3714 1.3621
09-Feb-10 1.3840 1.3650
10-Feb-10 1.3813 1.3676
11-Feb-10 1.3801 1.3595
12-Feb-10 1.3689 1.3532
15-Feb-10 1.3634 1.3578
16-Feb-10 1.3777 1.3588
17-Feb-10 1.3789 1.3586
18-Feb-10 1.3655 1.3498
19-Feb-10 1.3608 1.3454
22-Feb-10 1.3654 1.3573
23-Feb-10 1.3692 1.3497
24-Feb-10 1.3626 1.3502
25-Feb-10 1.3571 1.3451
26-Feb-10 1.3683 1.3535
01-Mar-10 1.3654 1.3461
02-Mar-10 1.3622 1.3435
Reply With Quote
  #6 (permalink)  
Old March 3rd, 2010, 01:28 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I would create the query to select top 20, or 10 etc, ordered by date DESC, and then use that query to build a report ordered by date Asc. Does that help?
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #7 (permalink)  
Old March 3rd, 2010, 01:38 PM
Registered User
 
Join Date: Feb 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access running summary

Hi again,
That sounds fine - till I see the result!
Makace
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running an Access Query from ASP arholly Access ASP 0 January 25th, 2008 03:31 PM
Running external applications from access thisgent Access VBA 2 July 9th, 2007 05:03 PM
validation summary MunishBhatia ASP.NET 2.0 Professional 1 May 11th, 2007 08:00 AM
Summary in footer Blueman137 ASP.NET 1.0 and 1.1 Basics 1 March 30th, 2004 06:48 PM
help with summary tags in .net nekblood VS.NET 2002/2003 0 July 9th, 2003 01:54 PM



All times are GMT -4. The time now is 09:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.