SORT BY DATE ??

M

Michael

I am curently having a big problem with my database. I have already preapared
a large table called: calibration with something like 150 records and 15
columns. The most important column is 'Date'. Lets say i have 150 different
tools- some of them are out of calibration date other are ok. So i'd like to
create a form where i'd have a command button. After click it will simply
show me which of my tolls are out of calibration date so i know that i have
to send them for calibration. I hope everything what i have written here is
clear enough to get my point. Perhaps there is a easier way to solve that
problem but this is my weekly task. My boss you know...
 
G

Golfinray

You need to build a query from your table. Then you can check any date you
want. Let's say that a tool has a date purchased and a date that it goes out
of commission. You could use a datediff command in your query.
Datediff("m",[date purchased],[dateexpires]). Or if you wanted to know how
many tools expired in October, you could use Between 10/1/2008 and Now(). So
it completely depends on how you want it set up. Your form would then run off
the query. Give us more information about what you want and we will try to
help.
 
M

MikeJohnB

You don't mention any field names in the table, but as a general comment, try
the following. (Change DueDate to your field name)

Write a query based on the table of interest, include all fields, in the
criteria row of the query in design mode, enter something like DueDate>Date()

The query will now only display records with a due date which is past todays
date.

Design a form based on the query, the form will only show records which are
pout of date.

You can now open the form with your button.

HTH
 
A

Arvin Meyer [MVP]

Michael said:
I am curently having a big problem with my database. I have already
preapared
a large table called: calibration with something like 150 records and 15
columns. The most important column is 'Date'. Lets say i have 150
different
tools- some of them are out of calibration date other are ok. So i'd like
to
create a form where i'd have a command button. After click it will simply
show me which of my tolls are out of calibration date so i know that i
have
to send them for calibration. I hope everything what i have written here
is
clear enough to get my point. Perhaps there is a easier way to solve that
problem but this is my weekly task. My boss you know...

First, it would be wise to rename the Date column to CalibrationDate or
something descriptive. "Date" is a reserved word, and will cause problems as
a fieldname if it isn't always surrounded by square brackets.

Now to solve your problem, use a query and add a column like:

NextCalibration: [CalibrationDate] = 60

or whatever the number of days you want to add is. Then if you want to see
only those records which are due now or are overdue for calibration, add the
expression:

< Date()

as a criteria to the new column.
 
K

KARL DEWEY

I recommend two tables - one for items and other for calibration history.
Equipment --
EquipID - autonumber - primary key
name - text
Model - text
Serial - text
SvcDate - Datetime
CalInterval - number - long integer
CalPeriod – text – ‘w’ week, ‘m’ month, ‘yyyy’ year, ‘d’ days
Deactive – Yes/No

CalHistory --
CalID - autonumber - primary key
EquipID - number - long integer - related to [Equipment].[EquipID]
CalDue - Datetime
CalDate - Datetime
Remarks – memo

Use a query to use last calibration date ( Max(CalDate) with Cal Period and
CalInterval to determine CalDue.
--- DateAdd([CalPeriod], [CalInterval], Max(CalDate))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top