Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. Max Demand Date Hour Store Number
  2. 420 7/1/2019 19 516
  3. 415 7/1/2019 20 6228
  4. 390 7/1/2019 17 520
  5. 402 7/1/2019 20 1363
  6. 357 7/1/2019 22 8949
  7.  
  8. SELECT [Time and Demand].Demand, [Time and Demand].[Store Number], Dates.Hour, Dates.ThisDate
  9. FROM Dates INNER JOIN [Time and Demand] ON Dates.[Date and Time] = [Time and Demand].[Date and Time]
  10.  
  11. WHERE Demand IN
  12.  
  13. (SELECT Max([Time and Demand].Demand) AS MaxOfDemand, [Time and Demand].[Store Number], Dates.ThisDate
  14.  
  15. FROM Dates INNER JOIN [Time and Demand] ON Dates.[Date and Time] = [Time and Demand].[Date and Time])
  16.  
  17.  
  18. GROUP BY [Time and Demand].[Store Number], Dates.ThisDate;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement