Update help

  • Is there something better I can do to make it more streamlined?

     

    BEGIN

     UPDATE tbl_leads_queue

     SET lead_status_id  = 7

     WHERE

      parent_lead_id = @LeadID

      AND partner_id = 19

      AND lead_status_id = 3

      AND

      (

       day(date_sent) = day(getdate())

       AND

       month(date_sent) = month(getdate())

       AND

       year(date_sent) = year(getdate())

     &nbsp

       

    END

  • UPDATE tbl_leads_queue

    SET lead_status_id  = 7

    WHERE parent_lead_id = @LeadID

        AND partner_id = 19

        AND lead_status_id = 3

        AND convert(varchar,date_sent,101) = convert(varchar, getdate(),101)

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • UPDATE tbl_leads_queue

     SET lead_status_id  = 7

     WHERE

      parent_lead_id = @LeadID

      AND partner_id = 19

      AND lead_status_id = 3

      AND date_sent between convert(datetime, convert(int, getdate()-0.5)) and convert(datetime, convert(int, getdate()+0.5)) - convert(datetime, '00:00:00.003')

     

    _____________
    Code for TallyGenerator

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply