Stored procedure to select between dates

  • ALTER PROCEDURE [dbo].[spname]

    @Supplier int

    AS

    BEGIN

    SELECT

    ProductScenario_PK, Supplier_FK,ProductID_FK,

    ChannelProductVariation_FK, WorkflowID_FK,

    FROM

    PRODUCT_SCENARIO

    LEFT OUTER JOIN

    PRODUCT_SCENARIO_SWIMLANE ON PRODUCT_SCENARIO.ProductScenario_PK = PRODUCT_SCENARIO_SWIMLANE.ProductScenario_FK

    WHERE

    Supplier_Fk = @Supplier

    I have column name FromDate and ToDate. I need to select the Id value between this two dates.

    Is it possible to use as WHERE Supplier_Fk = @Supplier and between FromDate and ToDate

    Does anyone know how to do this?

  • Where are FromDate and ToDate?

    One of the two tables?

    Parameters?

    You're not providing much information: could you please read the first article linked in my signature line? You'll find out how to post your question effectively and get replies quickly.

    -- Gianluca Sartori

  • FromDate and ToDate are column name from the table 'Product Scenario'

  • OK, what do you want to compare with those two columns? Current date? A parameter?

    -- Gianluca Sartori

Viewing 4 posts - 1 through 4 (of 4 total)

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