SQL Server Performance

Date Problem with Time.

Discussion in 'General Developer Questions' started by Claudia, Sep 2, 2003.

  1. Claudia New Member

    Hi all,
    I have one stored procedure which have startdate and enddate as parameter. If I execute the Stored Procedure with the startdate and enddate, it is taking time as 00:00:000 as default. But I want to take the default time as 00:00 for startdate and 23:59 for end date. Can anybody guide how to make this...advance thanks.
  2. satya Moderator

  3. Claudia New Member

    What I want is ...if I give the date without giving time for the paratmeters, then startdate should take the time 00:00 and enddate should take the time as 23:59
  4. bambola New Member


    declare @startDatedatetime,
    @endDatedatetime

    select @startdate = getdate()
    select @startdate = dateadd(dd, 0, datediff(dd, 0, @startdate))

    select @endDate = dateadd(ms, -2, dateadd(dd, 1, @startdate))
    select @startdate, @endDate
    Bambola.

Share This Page