Viewing 15 posts - 1 through 15 (of 188 total)
Thanks John and Thom. - I will try both solutions and report back.
October 31, 2018 at 11:43 am
October 24, 2018 at 11:41 am
select h.productkey,s.StartSaleDateKey, s.EndSaleDateKey, avg(l.SaleAmount)October 23, 2018 at 9:27 am
I think I have figured it out:
select k.ProductKey, cost, avgSaleAmount from #headerTable k
outer apply(
select * from #saleDateTable a
outer apply (
select...
October 23, 2018 at 7:45 am
Thanks Phil. I will keep IF Code in mind next time.
Desired results are such:
ProductKey AvgSaleAmount (within Sale Period)
1 ...
October 23, 2018 at 7:03 am
October 22, 2018 at 11:54 am
October 22, 2018 at 11:44 am
I see a similar solution in this post:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9834a8f9-2acf-4d2d-b4a7-78ad8be15d0a/how-to-produce-the-effect-of-a-date-range-inner-join-without-actually-doing-one?forum=transactsql
how should I go about constructing a calendar table in my case?
October 22, 2018 at 10:54 am
I dont think creating a calendar table from the base table will work.
I created a temp table from the base table:
select distinct startdate, enddate
into #calendar
from...
October 22, 2018 at 10:19 am
hi Lynn,
I don't have anything at this point. As I am struggling with how to actually write SQL for this.
I was looking for some example that...
October 22, 2018 at 9:51 am
Here is the DDL and insert statements for the sample data:
create table dateRangeTest(
saleid int,
salemarkdown decimal(3,2),
startdate date,
enddate date,
saleinpreviousyear varchar(5),
previousyearsaleID int
)
insert...
October 22, 2018 at 9:39 am
Just so I can explain it to the management what a read exactly means and of course for my own self.
March 19, 2013 at 3:35 pm
so how can I best interpret this? what does number of read mean? chunks of data in bytes? how big of chunk if that's the case.
how can I explain...
March 19, 2013 at 1:26 pm
Infact the issue that we run into most often is that some of these folks in prod have db_reader access whereas in dev they want full control as dbo so...
February 20, 2013 at 8:37 am
Viewing 15 posts - 1 through 15 (of 188 total)