Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sql = "SELECT ad.USER_NO, SUBSTRING(usr.DIVISION,4,3) KST, adc.VALUE STD, ad.DAY, adc.CATEGORY_ID " & _
- "FROM dbo.ANALYTICS_DAILY ad INNER JOIN " & _
- "dbo.ANALYTICS_DAILY_CATEGORIES adc ON ad.ID = adc.ANALYTICS_DAILY_ID INNER JOIN " & _
- "dbo.USERS usr ON ad.USER_NO = usr.NO " & _
- "where ad.DAY >= Cast('" & Cells(3, cColJahr) & "-" & Format(Cells(3, cColMonat), "00") & "-01' as Datetime) and " & _
- "ad.DAY < Cast('" & Cells(3, cColJahr) + IIf(Cells(3, cColMonat) = 12, 1, 0) & "-" & _
- Format(IIf(Cells(3, cColMonat) + 1 > 12, 1, Cells(3, cColMonat) + 1), "00") & "-01' as Datetime) and " & _
- "(adc.CATEGORY_ID=1 or adc.CATEGORY_ID=20 or adc.CATEGORY_ID=37) order by usr.DIVISION"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement