Tax Setup
I've tried this:
ALTER PROCEDURE [dbo].[Smith_GetTaxRate]
@CityName VARCHAR(255) ,
@State VARCHAR(50)
AS
IF ( @State = 'LA')
BEGIN
SELECT '4' AS [TaxRate]
END
ELSE
IF ( @CityName = 'Slidell' )
BEGIN
SELECT '8.75' AS [TaxRate]
END
ELSE
BEGIN
SELECT [TaxRate] FROM Smith_Tax
WHERE lower([City]) like lower(@CityName)
AND lower([State]) like (@State)
END
Then I tried this:
ALTER PROCEDURE [dbo].[Smith_GetTaxRate]
@CityName VARCHAR(255) ,
@State VARCHAR(50)
AS
BEGIN
IF ( @State = 'LA')
SELECT '4' AS [TaxRate]
ELSE
IF ( @CityName = 'Slidell')
SELECT '8.75' AS [TaxRate]
ELSE
SELECT [TaxRate] FROM Smith_Tax
WHERE lower([City]) like lower(@CityName)
AND lower([State]) like (@State)
END
This is my current Stored Procedure
USE [f_davis]
GO
/****** Object: StoredProcedure [dbo].[Smith_GetTaxRate] Script Date: 02/09/2010 18:32:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Smith_GetTaxRate]
@CityName VARCHAR(255) ,
@State VARCHAR(50)
AS
BEGIN
IF ( @State = 'LA')
SELECT '4' AS [TaxRate]
ELSE
IF ( @CityName = 'Slidell')
SELECT '8.75' AS [TaxRate]
ELSE
SELECT [TaxRate] FROM Smith_Tax
WHERE lower([City]) like lower(@CityName)
AND lower([State]) like (@State)
END
I think my problem is here:
I tried setting the tax rates as the Values and also the City/State as the Values.