Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE [LL_GPPS_2017]
- GO
- /****** Object: UserDefinedFunction [dbo].[udfGetExchangeRate] Script Date: 17/8/2017 9:57:22 AM ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- -- =============================================
- -- Author: Vitu Mhone <mhone.vitu@gmail.com>
- -- Create date: 16th August 2017 10:18 am
- -- Description: Function to get an exchange rate
- -- for a sale date
- -- =============================================
- ALTER FUNCTION [dbo].[udfGetExchangeRate]
- (
- @SaleDate date
- )
- RETURNS decimal(8,4)
- AS
- BEGIN
- DECLARE @SaleExchangeRate decimal(8,4)
- SELECT @SaleExchangeRate = SALE_EXCHANGE_RATE FROM [AHL_LL_2017].[dbo].[tbl_Sales] WHERE [SALE_DATE] = @SaleDate
- RETURN @SaleExchangeRate
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement