C
clueless
Hi,
I have spent a couple of weeks with this reading and trying and I am still
nowhere. I have 1 table tbl_Inbound/Outbound. I will be importing info from
an inbound sheet & an outbound sheet from Excel. This will serve as a yard
check on freight trailers. If a trailer comes in the yard, the status would
be open. When the trailer leaves the yard, the status would change to
closed. With it being in 1 table the inbound trailer is on 1 line and the
outbound trailer is on another line. This is where the water gets murky for
me. (I also tried with 2 tables and that didn't work either.) How do I
connect the 2 lines to close the trailer out? The second part is that the
same trailer can re-enter the yard again; the only difference would be the
arrival would change. Is this doable? Is the setup correct? Am I trying for
the impossible? I am using Access 2007. I have included what I have so far.
Fields
Transaction (primary key)
CarrierName
Trailer#
ArrivalDate
ArrivalTime
DepartureDate
DepartureTime
DriverName
Tractor#
OrderID
Outbound
Inbound
SELECT [tbl_Inbound/Outbound].CarrierName,
[tbl_Inbound/Outbound].[Trailer#], [tbl_Inbound/Outbound].[Tractor#],
IIf([ArrivalDate] And [ArrivalTime] Is Not
Null,DateValue([ArrivalDate])+TimeValue([ArrivalTime]),Null) AS Arrival,
[tbl_Inbound/Outbound].ArrivalDate, [tbl_Inbound/Outbound].ArrivalTime,
IIf([DepartureDate] And [DepartureTime] Is Not
Null,DateValue([DepartureDate])+TimeValue([DepartureTime]),Null) AS
Departure, [tbl_Inbound/Outbound].DepartureDate,
[tbl_Inbound/Outbound].DepartureTime, [tbl_Inbound/Outbound].OrderID,
IIf([OrderID] Is Not Null And [Inbound]="yes","IB/Loaded",IIf([OrderID] Is
Not Null And [Outbound]="yes","OB/Loaded","Empty")) AS TrailerStatus,
Diff2Dates("dh",[Arrival],Now()) AS DwellTime,
[tbl_Inbound/Outbound].Outbound, [tbl_Inbound/Outbound].Inbound
FROM [tbl_Inbound/Outbound];
I have spent a couple of weeks with this reading and trying and I am still
nowhere. I have 1 table tbl_Inbound/Outbound. I will be importing info from
an inbound sheet & an outbound sheet from Excel. This will serve as a yard
check on freight trailers. If a trailer comes in the yard, the status would
be open. When the trailer leaves the yard, the status would change to
closed. With it being in 1 table the inbound trailer is on 1 line and the
outbound trailer is on another line. This is where the water gets murky for
me. (I also tried with 2 tables and that didn't work either.) How do I
connect the 2 lines to close the trailer out? The second part is that the
same trailer can re-enter the yard again; the only difference would be the
arrival would change. Is this doable? Is the setup correct? Am I trying for
the impossible? I am using Access 2007. I have included what I have so far.
Fields
Transaction (primary key)
CarrierName
Trailer#
ArrivalDate
ArrivalTime
DepartureDate
DepartureTime
DriverName
Tractor#
OrderID
Outbound
Inbound
SELECT [tbl_Inbound/Outbound].CarrierName,
[tbl_Inbound/Outbound].[Trailer#], [tbl_Inbound/Outbound].[Tractor#],
IIf([ArrivalDate] And [ArrivalTime] Is Not
Null,DateValue([ArrivalDate])+TimeValue([ArrivalTime]),Null) AS Arrival,
[tbl_Inbound/Outbound].ArrivalDate, [tbl_Inbound/Outbound].ArrivalTime,
IIf([DepartureDate] And [DepartureTime] Is Not
Null,DateValue([DepartureDate])+TimeValue([DepartureTime]),Null) AS
Departure, [tbl_Inbound/Outbound].DepartureDate,
[tbl_Inbound/Outbound].DepartureTime, [tbl_Inbound/Outbound].OrderID,
IIf([OrderID] Is Not Null And [Inbound]="yes","IB/Loaded",IIf([OrderID] Is
Not Null And [Outbound]="yes","OB/Loaded","Empty")) AS TrailerStatus,
Diff2Dates("dh",[Arrival],Now()) AS DwellTime,
[tbl_Inbound/Outbound].Outbound, [tbl_Inbound/Outbound].Inbound
FROM [tbl_Inbound/Outbound];