mswilson16
Programmer
I have a database that was designed by an x-employee. I am currently creating reports for it. I can not alter the design of the tables. I have a table called "tblDelivery", which has fields:
EventID
Delivery Date
Delivery Time
Pickup Date
Pickup Time
What I need to do is create a daily schedule for pickups/Deliveries. It is easy to create the schedule for either the pickup or delivery but I want a complete Delivery/Pickup list that would look like:
EventID Time Type
1 9.00 am Delivery
2 10.00 am Delivery
3 10.30 am Delivery
1 10.45 am Pickup
4 11.00 am Delivery
2 11.30 am Pickup
4 13.45 pm Pickup
3 15.00 pm Pickup
So as you can see I would need to create two records for everyone one record (a pickup record and delivery record). I have done this by creating 2 queries. But now I need to make the 2 queries into one long list of pickups and deliveries.
If any one can help me out then that would be create. I have read all other posts and it seems that a union Query is what I am looking for. But I get a syntax error when ever I run it. here is the SQL:
**********************
SELECT Tbl_Delivery.EventID, Tbl_Delivery.pickdate, eventsxt.pickfrtime, Tbl_Delivery.picktotime
FROM Tbl_Delivery
WHERE (((Tbl_Delivery.EventID)=3448))
UNION SELECT Tbl_Delivery.EventID, Tbl_Delivery.del_date,Tbl_Delivery.equipleave, Tbl_Delivery.equipdeliv
FROM Tbl_Delivery
WHERE (((Tbl_Delivery.EventID)=3448));
******************
If anyone has any idea of how to help that would be great. Thanks in advance.
Wilson
EventID
Delivery Date
Delivery Time
Pickup Date
Pickup Time
What I need to do is create a daily schedule for pickups/Deliveries. It is easy to create the schedule for either the pickup or delivery but I want a complete Delivery/Pickup list that would look like:
EventID Time Type
1 9.00 am Delivery
2 10.00 am Delivery
3 10.30 am Delivery
1 10.45 am Pickup
4 11.00 am Delivery
2 11.30 am Pickup
4 13.45 pm Pickup
3 15.00 pm Pickup
So as you can see I would need to create two records for everyone one record (a pickup record and delivery record). I have done this by creating 2 queries. But now I need to make the 2 queries into one long list of pickups and deliveries.
If any one can help me out then that would be create. I have read all other posts and it seems that a union Query is what I am looking for. But I get a syntax error when ever I run it. here is the SQL:
**********************
SELECT Tbl_Delivery.EventID, Tbl_Delivery.pickdate, eventsxt.pickfrtime, Tbl_Delivery.picktotime
FROM Tbl_Delivery
WHERE (((Tbl_Delivery.EventID)=3448))
UNION SELECT Tbl_Delivery.EventID, Tbl_Delivery.del_date,Tbl_Delivery.equipleave, Tbl_Delivery.equipdeliv
FROM Tbl_Delivery
WHERE (((Tbl_Delivery.EventID)=3448));
******************
If anyone has any idea of how to help that would be great. Thanks in advance.
Wilson