Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: "Declare"

$
0
0

Hi Stephanie,

 

Adding to Thomas's reply.

 

Adding the syntax here in case it helps you.

 

declare WMSDB varchar(30);
declare xAISWMEventLog varchar(250);
WMSDB :=  'AISWM' || 'DB NAME';
xAISWMEventLog  = 'CREATE SYNONYM xAISWMEventLog FOR ' || :WMSDB ||'.dbo.xAISWMEventLog';
EXEC (:xAISWMEventLog);
select [DateTime],
CASE when YEAR(datetime) = YEAR(CURRENT_TIMESTAMP) then 1 else 0 end as YTD,
CASE when YEAR(datetime) = YEAR(CURRENT_TIMESTAMP) and Month(datetime) = MONTH(CURRENT_TIMESTAMP) then 1 else 0 end as MTD,
CASE when YEAR(datetime) = YEAR(CURRENT_TIMESTAMP)) and Month(datetime) = MONTH(CURRENT_TIMESTAMP) and DAYOFMONTH (datetime) = DAYOFMONTH (CURRENT_TIMESTAMP) then 1 else 0 end as TODAY,
UserID,SOID,DocEntry, InvtID, WhseLoc,LineRef,SiteID, SlpCode, a.Quantity, LineTotal
FROM xAISWMEventLog a
left outer join RDR1 on rdr1.DocEntry = a.soid and rdr1.LineNum = a.LineRef  where     a.EventTyp = 'SHIP' and a.LnAction = 'Finish'
drop SYNONYM xAISWMEventLog

 

Regards,

Krishna Tangudu


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>