Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.76 KB | None | 0 0
  1. use gala_shop
  2.  
  3. go
  4.  Select
  5.  ArhivCHJekKKM._Date_Time As DocDate ,
  6.      Podrazdeleniyaaa._Description As Shop ,
  7.      Count ( Distinct ArhivCHJekKKM._IDRRef ) As Number
  8.  From
  9.      _Document177 As OtchjetORoznichjnjhProdazhhhah
  10.      Inner Join _Document7888 As ArhivCHJekKKM
  11.          On OtchjetORoznichjnjhProdazhhhah._Fld3734RRef = ArhivCHJekKKM._Fld7891RRef
  12.      Inner Join _Reference68 As Podrazdeleniyaaa
  13.          On OtchjetORoznichjnjhProdazhhhah._Fld3740RRef = Podrazdeleniyaaa._IDRRef      
  14.  Where
  15.      OtchjetORoznichjnjhProdazhhhah._Date_Time Between '30/09/2010 00:00:00' And '01/10/2010 00:00:00' And
  16.      ArhivCHJekKKM._Date_Time Between '30/09/2010 00:00:00' And '01/10/2010 00:00:00'
  17.  Group By
  18.      Podrazdeleniyaaa._Description,
  19.      ArhivCHJekKKM._Date_Time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement