Northwind Database (Document! X Sample)
dbo.ufnGetAccountingEndDate User Defined Function
AdventureWorks Database > dbo Schema : dbo.ufnGetAccountingEndDate User Defined Function
Description
Scalar function used in the uSalesOrderHeader trigger to set the starting account date.
Properties
Creation Date27/10/2017 14:33
Encrypted
Ansi Nulls
Parameters
ParameterDirectionDescriptionData TypeSize
Return Value DBTimeStamp4
Objects that depend on dbo.ufnGetAccountingEndDate
 Database ObjectObject TypeDescriptionDep Level
iduSalesOrderDetail triggeriduSalesOrderDetailTriggerAFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.3
Sales.SalesOrderDetail tableSales.SalesOrderDetailTableIndividual products associated with a specific sales order. See SalesOrderHeader.2
Sales.SalesOrderHeader tableSales.SalesOrderHeaderTableGeneral sales order information.1
Sales.SalesOrderHeaderSalesReason tableSales.SalesOrderHeaderSalesReasonTableCross-reference table mapping sales orders to sales reason codes.2
uSalesOrderHeader triggeruSalesOrderHeaderTriggerAFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables.2
Sales.vSalesPersonSalesByFiscalYears viewSales.vSalesPersonSalesByFiscalYearsViewUses PIVOT to return aggregated sales information for each sales representative.2
Procedure Source Code
CREATE FUNCTION [dbo].[ufnGetAccountingEndDate]()
RETURNS [datetime] 
AS 

BEGIN
    RETURN DATEADD(millisecond, -2, CONVERT(datetime, '20040701', 112));
END;
See Also

Related Objects

dbo Schema
AdventureWorks Database