Forum Replies Created

Viewing 15 posts - 1 through 15 (of 64 total)

  • RE: Removing redundant information

    Jeff, (or anyone)

    Any word on this query?

    here's what I have now:

    SELECT FirstListing,OnCallStart,OnCallEnd

    FROM

    (

    SELECT

    moncallAdd.FirstListing,

    DATEADD(MINUTE, mOnCallAdd.StartOnCallTime,

    ...

  • RE: Removing redundant information

    jeff,

    Sorry. Here is the delete data:

    --===== If the test table already exists, drop it

    IF OBJECT_ID('TempDB..#moncalldelete','U') IS NOT NULL

    ...

  • RE: Removing redundant information

    Jeff,

    I've had to modify the query a bit, because now we're using the adddate and addtime to be able to eliminate duplicate data. So here's the query as it stands...

  • RE: Removing redundant information

    Sergiy,

    Ok so I have this revised query now:

    SELECT

    moncallAdd.FirstListing,

    DATEADD(MINUTE, mOnCallAdd.StartOnCallTime,

    DATEADD(DAY, mOnCallAdd.StartOnCallDate,...

  • RE: Removing redundant information

    Sergiy,

    I did as you suggested, and ran all 3 queries.

    Query 1 returned 23 lines of data

    Query 2 returned 10 lines of data

    Query 3 returned 33 lines of data

    Now what I...

  • RE: Removing redundant information

    Jeff,

    I've tried that and didn't get back all of the correct results. I did a line by line comparison for running my query with everything after the union statement removed...

  • RE: Removing redundant information

    If I modify my query to be this:

    SELECT

    moncallAdd.FirstListing,

    DATEADD(MINUTE, mOnCallAdd.StartOnCallTime,

    DATEADD(DAY, mOnCallAdd.StartOnCallDate, '12/31/1899')) AS OnCallStart,

    DATEADD(MINUTE, mOnCallAdd.duration,

    DATEADD(MINUTE, mOnCallAdd.StartOnCallTime,

    DATEADD(DAY, mOnCallAdd.StartOnCallDate, '12/31/1899'))) AS OnCallEnd,

    'Added' AS Activity

    FROM

    mdr.dbo.mOnCallAdd

    WHERE...

  • RE: Removing redundant information

    Jeff,

    here's the original query this was built off of:

    SELECT

    mOnCallAdd.SchedName,

    DATEADD(MINUTE, mOnCallAdd.AddTime,

    DATEADD(DAY,...

  • RE: Removing redundant information

    Table definitions are as follows:

    StartDate Int

    StartTime Int

    Firstlisting nvarchar

    duration decimal

    adddate int

    addtime int

    Do you need more than that?

  • RE: Getting current date as part of an Stored Procedure

    Actually ... in going back through my code, I realized I missed something. The time and date for this process is stored in two fields. Start time and start date....

  • RE: Getting current date as part of an Stored Procedure

    I'm not sure what you're saying that >= is there. Are you saying that I'm not seeing something else?

  • RE: Getting current date as part of an Stored Procedure

    Ninja,

    I'm aware that <>= are comparative operators. What I was asking is where does your code fit into what I'm asking to do? My code is complete and all I'm...

  • RE: Getting current date as part of an Stored Procedure

    Ninja,

    Here's how I have the SP coded now:

    SELECT

    moncallAdd.FirstListing,

    DATEADD(MINUTE, mOnCallAdd.StartOnCallTime,

    DATEADD(DAY, mOnCallAdd.StartOnCallDate,...

  • RE: Getting current date as part of an Stored Procedure

    Jeff,

    Thank you for your response. What I've since discovered is as follows:

    My query needs to return values for date/times up to the current time. In other words, say I have...

  • RE: Getting current date as part of an Stored Procedure

    Ninja,

    the variable of @sincedate is just declared as datetime. If I run this SP with just the date, then I have no issue, but as Gila stated, if I run...

Viewing 15 posts - 1 through 15 (of 64 total)