I have a short time field and I am trying to get the hour portion without the
minutes.
For 17:00 I would like to return 17 and for 07:00 return 07
I have tried the left function but that returns 7: for 7:00 (which makes
sense) but it also returns 5: for 17:00
Can anyone help me return the values before the semicolon. I would like to
end up with 07 and 17
Here is the SQL I have if it helps
SELECT Tbl_UnitHours.UHID, Tbl_UnitHours.ShiftAssignedTo,
Tbl_UnitHours.StartTime, Tbl_UnitHours.EndTime, "(" &
[Tbl_DayofWeek]![DayAbrv] & ")" & [Qry_Stations]![StationAbrv] & "(" &
[Qry_Units]![Unit Abrv] & ")" AS Shift, Left([Tbl_UnitHours]![StartTime],2)
AS Expr1
FROM ((Tbl_UnitHours INNER JOIN Tbl_DayofWeek ON Tbl_UnitHours.DayofWeek =
Tbl_DayofWeek.DayID) INNER JOIN Qry_Stations ON Tbl_UnitHours.Station =
Qry_Stations.StationID) INNER JOIN Qry_Units ON Tbl_UnitHours.Unit =
Qry_Units.UnitID;
KARL DEWEY - 01 Nov 2007 19:00 GMT
Try this --
Format([Tbl_UnitHours]![StartTime],"hh") AS Expr1

Signature
KARL DEWEY
Build a little - Test a little
> I have a short time field and I am trying to get the hour portion without the
> minutes.
[quoted text clipped - 17 lines]
> Qry_Stations.StationID) INNER JOIN Qry_Units ON Tbl_UnitHours.Unit =
> Qry_Units.UnitID;
Jason - 01 Nov 2007 19:12 GMT
That got it thank you
> Try this --
> Format([Tbl_UnitHours]![StartTime],"hh") AS Expr1
[quoted text clipped - 20 lines]
> > Qry_Stations.StationID) INNER JOIN Qry_Units ON Tbl_UnitHours.Unit =
> > Qry_Units.UnitID;