Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

14 day blocks of data

Status
Not open for further replies.

aids2

Technical User
Mar 20, 2003
18
AU
I need a query that sorts data into 14 day blocks and then displays the results in a stacked bar chart?
The data is continuously updated so I require the query to constantly sort the data without any changes to the original query.
 
create a digits table 1 field type number from 1 to .....


run this query

Code:
SELECT  Digits.DigitID, DateAdd("d",[digitid],Date()) AS Dateval, Int(([DigitID]-1)/14) AS groupnum
FROM Digits;
 
forgot to include code for digit table

Code:
Sub DigitTable(MaxNumber)
Dim Mydb As Database
Dim Num As Long
Set Mydb = CurrentDb
Mydb.Execute "Create Table Digits (Digitid INTEGER CONSTRAINT Digitid PRIMARY KEY)"
For Num = 1 To MaxNumber
    Mydb.Execute "Insert Into Digits (Digitid) Values (" & Num & ")"
Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top