I need a database guru.

G

Guest

I have an asp page with a form that is used for signing equipment in and out.

The 3 form fields are:

Employee name, Equipment number, and Supervisor name. Each field has some
simple client side validation.

Here's what I need help with:

Before the form can be submitted successfully, I would like to run a query
that looks up the last time the same equipment number that is being entered
into the form was checked in or out.

If the status comes back as checked out, I would like an error to pop up
saying that this item needs to be checked back in before it can be checked
out again.

If the status comes back as "IN" I would like a message to say this item was
already checked in.

This is to insure that all equipment gets checked back in at the end of each
shift.


Here's the query:

SELECT TOP 1 RF.Employee_Name, RF.EQUIP_Number, RF.[In/Out],
Max(RF.Entry_Date) AS MaxOfEntry_Date, Max(RF.Entry_Time) AS MaxOfEntry_Time
FROM RF
GROUP BY RF.Employee_Name, RF.EQUIP_Number, RF.[In/Out]
ORDER BY Max(RF.Entry_Date) DESC , Max(RF.Entry_Time) DESC;

How do I get this query to run in the background (without displaying the
data on my page) and how do I code the page to do check the IN/OUT status?
 
M

[MVP] S.Clark

Using ADO, open this query into a recordset. Check the value of the status
field.
 
G

Guest

Thanks for the quick reply. Can you explain how to do this?

I'm reading some tutorials on ASP and ADO but I'm not sure how to do what
you suggested. This is all new to me.

Thanks.



[MVP] S.Clark said:
Using ADO, open this query into a recordset. Check the value of the status
field.

--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

Jeff said:
I have an asp page with a form that is used for signing equipment in and
out.

The 3 form fields are:

Employee name, Equipment number, and Supervisor name. Each field has some
simple client side validation.

Here's what I need help with:

Before the form can be submitted successfully, I would like to run a query
that looks up the last time the same equipment number that is being
entered
into the form was checked in or out.

If the status comes back as checked out, I would like an error to pop up
saying that this item needs to be checked back in before it can be checked
out again.

If the status comes back as "IN" I would like a message to say this item
was
already checked in.

This is to insure that all equipment gets checked back in at the end of
each
shift.


Here's the query:

SELECT TOP 1 RF.Employee_Name, RF.EQUIP_Number, RF.[In/Out],
Max(RF.Entry_Date) AS MaxOfEntry_Date, Max(RF.Entry_Time) AS
MaxOfEntry_Time
FROM RF
GROUP BY RF.Employee_Name, RF.EQUIP_Number, RF.[In/Out]
ORDER BY Max(RF.Entry_Date) DESC , Max(RF.Entry_Time) DESC;

How do I get this query to run in the background (without displaying the
data on my page) and how do I code the page to do check the IN/OUT status?
 
M

[MVP] S.Clark

This is where I learnt it: http://asp101.com/

Hunderds of examples.

--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

Jeff said:
Thanks for the quick reply. Can you explain how to do this?

I'm reading some tutorials on ASP and ADO but I'm not sure how to do what
you suggested. This is all new to me.

Thanks.



[MVP] S.Clark said:
Using ADO, open this query into a recordset. Check the value of the
status
field.

--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

Jeff said:
I have an asp page with a form that is used for signing equipment in and
out.

The 3 form fields are:

Employee name, Equipment number, and Supervisor name. Each field has
some
simple client side validation.

Here's what I need help with:

Before the form can be submitted successfully, I would like to run a
query
that looks up the last time the same equipment number that is being
entered
into the form was checked in or out.

If the status comes back as checked out, I would like an error to pop
up
saying that this item needs to be checked back in before it can be
checked
out again.

If the status comes back as "IN" I would like a message to say this
item
was
already checked in.

This is to insure that all equipment gets checked back in at the end of
each
shift.


Here's the query:

SELECT TOP 1 RF.Employee_Name, RF.EQUIP_Number, RF.[In/Out],
Max(RF.Entry_Date) AS MaxOfEntry_Date, Max(RF.Entry_Time) AS
MaxOfEntry_Time
FROM RF
GROUP BY RF.Employee_Name, RF.EQUIP_Number, RF.[In/Out]
ORDER BY Max(RF.Entry_Date) DESC , Max(RF.Entry_Time) DESC;

How do I get this query to run in the background (without displaying
the
data on my page) and how do I code the page to do check the IN/OUT
status?
 

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