filter by time

Discussion in 'ASP .Net' started by g-fro, Jun 24, 2003.

  1. g-fro

    g-fro Guest

    My stored procedure is below. I would like to be able to take the
    delaydata.timestamp 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.

    <************BEGIN STORED PROCEDURE *********>
    ALTER PROCEDURE dbo.GetDelayData

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

    AS
    SELECT *
    FROM
    DelayData
    WHERE
    (Convert(datetime,DelayData.TimeStamp) between @startdate and
    (@endDate + 1))
    and (DelayData.cell=@cell OR @cell='*')
    and (DelayData.UserName=@user OR @user='*')
    Order by Convert(datetime,DelayData.TimeStamp) ASC

    <***********END 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.
    g-fro, Jun 24, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. engsol
    Replies:
    2
    Views:
    927
    Dan Bishop
    Jan 26, 2004
  2. Replies:
    8
    Views:
    459
    Magnus Lycka
    Aug 5, 2005
  3. Peter Hansen
    Replies:
    0
    Views:
    701
    Peter Hansen
    Feb 22, 2006
  4. flamesrock
    Replies:
    8
    Views:
    433
    Hendrik van Rooyen
    Nov 24, 2006
  5. zax75
    Replies:
    1
    Views:
    1,083
Loading...

Share This Page