Make Table Query- a julian date field

AmyLynnHill

Registered User.
Local time
Today, 15:12
Joined
Dec 7, 2005
Messages
81
I am extracting information from a datawarehouse with a make table query. I will run this queary one time to create the table. Then I plan on creating an append queary to extract the same fields on a weekly basis. I want to keep track of the datasets that i extract weekly. I thought I could create a field with a julian date or the week of the year. Does anyone know how I could create this field in my append queary? OR any thoughts on how i can keep track of the records appended each week?
 
Hi -
Assuming that week range (e.g., Monday - Sunday) will be the same each week, the following query prompts for a date, which can be any date in the desired week, and returns all records from the week. It's currently setup to return Monday thru Sunday.

Try copying/pasting to a new query, then modifying the table and field names to correspond to your application.
Code:
SELECT
    OrderID
  , CustomerID
  , OrderDate
FROM
   [Copy of Orders]
WHERE
   (((OrderDate) Between DateAdd("d",-(Weekday([enter a date])-2),[enter a date]) 
AND
   DateAdd("d",8-Weekday([enter a date]),[enter a date])));

HTH - Bob
 
If I follow you will be appending new frecords from the warehouse on a weekly basis. You want to tag the records so you know when they were appended.

The easiest way to do this is to add a field to your table call it CreateWhen and set the default value to =Date(). Then, whenever you append records, the current date will be filled in. You can fill in this field for the initial Make table using an Update query:

UPDATE table SET CreateWhen = #createdate#;
 

Users who are viewing this thread

Back
Top Bottom