PeopleSoft Adoption Made Smooth & Simple!
On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool. Claim Your Free WalkMe Account Now
DECLARE @totalOrderCount INT BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. --SET NOCOUNT ON; SET @totalOrderCount = (SELECT COUNT(o.orders_id) FROM orders O WHERE o.orders_status = 4 AND DATEDIFF(DAY, o.date_purchased, GETDATE()) < 31) SELECT COUNT(o.orders_id) AS ordercount, (DATEDIFF(DAY, o.date_purchased, osh.orders_status_history_timestamp)) AS timetaken, (COUNT(o.orders_id) / @totalOrderCount) AS orderPC, @totalOrderCount AS orderTotal FROM orders O, dbo.tblPS_orders_status_history OSH WHERE o.orders_status = 4
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.