All Questions
6
questions
4
votes
1
answer
235
views
SQL query to count loans issued during each week
Calculate the number of loans issued by the Regional offices for each business week in the period from 38 to 40 business week of 2011 inclusive. Sort by name of the regional unit, business week.
...
1
vote
1
answer
72
views
Query to generate payroll based on attendance for a month
I have written a query to generate payroll based on attendance for a month, for about 4000 employees. It takes quite a long time to execute. Basically, what I am doing is to joining two different ...
0
votes
1
answer
1k
views
T-SQL query outer apply with nested subqueries
I have the following 3 tables, and I don't have the option to modify them.
[Logs] table with [log_type], ...
4
votes
2
answers
66
views
Acquiring earnings information
The first part of the query grabs Policy's Premiums, Effective and ...
6
votes
1
answer
140
views
Report for a restaurant showing hourly sales information for a given timespan
I have been tasked with creating a report for a high-volume restaurant that shows hourly sales information for a given timespan. When generating this report for a single day, it's very quick, but when ...
12
votes
4
answers
15k
views
LW, MTD, STD, YTD Sales... all in line and looking pretty
That's Last Week, Month-to-Date, Season-to-Date, and Year-to-Date sales.
I have a table-valued function for each one, that takes a date and returns all CalendarDate...