Pages

Banner 468 x 60px

 

Thursday, November 16, 2017

Max off in SQL

0 comments
Sample Max off in SQL :

SELECT DISTINCT INVENTJOURNALTABLE.JOURNALID+INVENTDIM.INVENTLOCATIONID AS STInternalTransferInID,
Dateadd(hour, 7, INVENTJOURNALTABLE.POSTEDDATETIME) as ITNDate,
Dateadd(hour, 7, (SELECT MAX(INVENTJOURNALTRANS.TRANSDATE)
from INVENTJOURNALTRANS where INVENTJOURNALTRANS.JOURNALID = inventjournalTable.JOURNALID)) as Transdate,
INVENTJOURNALTABLE.INVENTLOCATIONID As SendersLocationID,
INVENTDIM.INVENTLOCATIONID AS EstateID,
INVENTJOURNALTABLE.POSTED,
INVENTJOURNALTABLE.DESCRIPTION AS Remarks,
INVENTJOURNALTABLE.CREATEDBY,
INVENTJOURNALTABLE.MODIFIEDBY,
Dateadd(hour, 7, INVENTJOURNALTABLE.MODIFIEDDATETIME) as ModifiedOn,
Dateadd(hour, 7, INVENTJOURNALTABLE.POSTEDDATETIME) as CreateOn,
INVENTJOURNALTABLE.DATAAREAID
FROM INVENTJOURNALTABLE
inner join INVENTJOURNALTRANS ON INVENTJOURNALTABLE.JOURNALID = INVENTJOURNALTRANS.JOURNALID
inner join inventdim on inventdim.INVENTDIMID = INVENTJOURNALTRANS.TOINVENTDIMID
WHERE (INVENTJOURNALTABLE.DATAAREAID = 'BSP') AND (INVENTJOURNALTABLE.JOURNALTYPE = 2) AND INVENTJOURNALTABLE.BIT_TransferToIplant = '1'

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