Pages

Banner 468 x 60px

 

Monday, March 27, 2017

Isnull SQL Query

0 comments
Isnull SQL Query :

SELECT [DB_Staging].[Store].[STIssueDetails].EstateID +[DB_Staging].[Store].[STIssueDetails].[STIssueID] As [JOURNALID]
 ,[DB_Staging].[Store].[STIssueDetails].[Linenum]
,[DB_Staging].[Store].[STIssueDetails].[STIssueDetailsID] AS Voucher
 ,[DB_Staging].[Store].[STIssueDetails].[StockID] AS [ITEMID]
 ,abs([DB_Staging].[Store].[STIssueDetails].[IssuedQty]) * -1 AS [QTY]
 ,[DB_Staging].[General].[Estate].InventDimID AS INVENTDIMID
 ,Isnull([DB_Staging].[Store].[STIssueDetails].[COAID],'') as [BIT_MainaccountNum]
 ,Isnull([DB_Staging].[Store].[STIssueDetails].[CashFlow],'') as [BIT_CASHFLOW]
 ,isnull([DB_Staging].[Store].[STIssueDetails].[Location],'') as [BIT_LOCATION]
,isnull([DB_Staging].[Store].[STIssueDetails].[Division],'') AS [BIT_DIVISION]
 ,isnull([DB_Staging].[Store].[STIssueDetails].[YOPid],'') AS [BIT_YOPID]
,isnull([DB_Staging].[Store].[STIssueDetails].[Fields],'') AS [BIT_FIELDS]
,isnull([DB_Staging].[Store].[STIssueDetails].[Vehicle],'') AS [BIT_VEHICLE]
 ,isnull([DB_Staging].[Store].[STIssueDetails].[Station],'') AS [BIT_STATION]
 ,isnull([DB_Staging].[Store].[STIssueDetails].[Category],'') AS [BIT_CATEGORY]
 ,[DB_Staging].[Store].[STIssueDetails].[EstateID] AS BIT_INVENTLOCATIONID
 ,ABS([DB_Staging].[Store].[STIssueDetails].[IssueUnitPrice]) AS [COSTPRICE]
 ,ABS([DB_Staging].[Store].[STIssueDetails].[IssuedValue]) * -1 AS [COSTAMOUNT]
 ,[DB_Staging].[Store].[STIssueDetails].[CreatedBy]
 ,[DB_Staging].[Store].[STIssueDetails].[ModifiedBy]
 ,Dateadd(hour, -7, [DB_Staging].[Store].[STIssueDetails].[CreatedOn]) as [Transdate]
 ,Dateadd(hour, -7, [DB_Staging].[Store].[STIssueDetails].[ModifiedOn]) AS [MODIFIEDDATETIME]
 ,dateadd(hour, -7, [DB_Staging].[Store].[STIssueDetails].[CreatedOn]) AS [CREATEDDATETIME]
 ,dateadd(hour, -7, [DB_Staging].[Store].[STIssueDetails].[CreatedOn]) AS [INTRASTATFULFILLMENTDATE_HU]
 ,'1900-01-01 00:00:00.000' AS [RELEASEDATE]
 ,[DB_Staging].[Store].[STIssueDetails].[DataAreaId]
 ,[DB_Staging].[Store].[STIssueDetails].[RECID] AS RECID
  FROM [DB_Staging].[Store].[STIssueDetails]
inner join [DB_Staging].[General].[Estate]
on [DB_Staging].[General].[Estate].EstateID =  [DB_Staging].[Store].[STIssueDetails].EstateID

0 comments:

A financial dimension value is based on the record and has been used on a transaction. You cannot delete the record

  SOLUTION delete in table DimensionAttributeLevelValue base on Bank Account  :  and Delete the Bank Account FINISH