filter by time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • g-fro

    filter by time

    My stored procedure is below. I would like to be able to take the
    delaydata.times tamp field and grab only the records during a certain
    hour. How would I go about doing this? Currently I filter by Cell,
    Date and User.

    <************BE GIN STORED PROCEDURE *********>
    ALTER PROCEDURE dbo.GetDelayDat a

    @startDate as datetime,
    @endDate as datetime,
    @cell as nvarchar,
    @user as nvarchar(20)

    AS
    SELECT *
    FROM
    DelayData
    WHERE
    (Convert(dateti me,DelayData.Ti meStamp) between @startdate and
    (@endDate + 1))
    and (DelayData.cell =@cell OR @cell='*')
    and (DelayData.User Name=@user OR @user='*')
    Order by Convert(datetim e,DelayData.Tim eStamp) ASC

    <***********E ND PROCEDURE****** *>

    TimeStamp is the name of the field. I don't like the naming
    conventions in this table but it is not a table created by me. I
    would think this would be rather easy to do, but I haven't been able
    to find any documentation on this.

    Any help would be appreciated.
Working...