Poor question,,
Hii, i want to create Report for CRM 2016 On-premise using pre-filtering. I have a query like below :
;with cte as (select dbo.new_troubleticket.new_troubleticketid, dbo.new_actiontaken.new_name as [Action Taken], dbo.new_troubleticket.new_rootcauseidname as [Root Cause] from dbo.new_new_troubleticket_new_actiontaken INNER JOIN new_troubleticket ON new_new_troubleticket_new_actiontaken.new_troubleticketid = new_troubleticket.new_troubleticketid INNER JOIN new_actiontaken ON new_new_troubleticket_new_actiontaken.new_actiontakenid = new_actiontaken.new_actiontakenid) , cte1 as (Select new_serviceId, dbo.Account.new_CustomerID as [Customer ID],new_accountidname as [Name] from new_service LEFT JOIN Account ON new_service.new_AccountId = Account.AccountId) Select dbo.new_troubleticket.new_name as [Ticket ID], dbo.new_troubleticket.new_referalticketname as [Referral Ticket],dbo.new_service.new_Building1 as Link, Dateadd(mi, datediff(mi, getutcdate(), getdate()), new_startdown) As [Down Time], Dateadd(mi, datediff(mi, getutcdate(), getdate()), new_startup) As [Up Time], dbo.new_service.new_AccountIdName as [Customer Name], cte1.[Customer ID], dbo.new_service.new_name as [Link ID], dbo.new_service.new_Building1 as [Link Name] , dbo.new_troubleticket.new_RootCauseIdName, dbo.new_troubleticket.new_TTActionTaken ,FLOOR((new_troubleticketservice.new_duration*60)/86400) AS HARI ,FLOOR(((new_troubleticketservice.new_duration*60)/3600) - FLOOR((new_troubleticketservice.new_duration*60)/86400) *24) AS JAM ,FLOOR(((new_troubleticketservice.new_duration*60)/60) - FLOOR((new_troubleticketservice.new_duration*60)/3600) *60) AS MENIT , new_troubleticketservice.new_duration as [Menit Total] from new_troubleticketservice LEFT JOIN new_troubleticket ON new_troubleticketservice.new_TroubleTicketId = new_troubleticket.new_troubleticketId LEFT JOIN cte on new_troubleticketservice.new_troubleticketId = cte.new_troubleticketid LEFT JOIN new_service ON new_troubleticketservice.new_ServiceId = new_service.new_serviceId LEFT JOIN cte1 on new_troubleticketservice.new_ServiceId = cte1.new_serviceId where cte1.[Name] like 'Company a'
Where should i put 'AS CRMAF_FilteredAccount' ?
On the example i get from the internet, they put 'AS CRMAF_' right after 'From table_name'. Is it same with my query ?
*This post is locked for comments