Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Stored procedure to select between dates?

$
0
0
 

I am writing a stored proc to Select information, I would like it to only 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 EffectiveFrom and EffectiveTo in PRODUCT_SCENARIO table. I need to select the Id value between this two dates.
Is it possible to use as WHERE Supplier_Fk = @Supplier and betweenEffectiveFrom andEffectiveTo 

Does anyone know how to do this?

Thanks


Viewing all articles
Browse latest Browse all 7129

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>