#DateForumTypeThreadPost
1025 Apr 2015 @ 10:02 PDTDatabaseReplyaggregate function based on multiple rows Thanks vandeberg,   that worked I'll just have to create an ad_hoc table I guess for the sales table so I'm not re-calculating the same data twice.    Just wondering if i...
925 Apr 2015 @ 12:17 PDTDatabaseReplyaggregate function based on multiple rows Manib,   i tried it and got an error message that object table_b does not exist
825 Apr 2015 @ 12:04 PDTDatabaseReplyaggregate function based on multiple rows Select a.state ,a.yrwk as year_wk ,a.week ,a.yr ,sum(case when yrwk is not null then a.sales else 0 end) as Ty_sales ,sum(case when year_wk = a.Ly_wk then a.sales end) as ly_sales From a ...
725 Apr 2015 @ 07:01 PDTDatabaseReplyaggregate function based on multiple rows I appreciate the quick response but There is no table B. My hope was to not have to create an additional table if possible   I was thinking there was a function that would allow me to referen...
624 Apr 2015 @ 05:38 PDTDatabaseTopicaggregate function based on multiple rows I am trying to perform a sum based on multiple values in a table.   The current year week is formated like this 201401 for 2014 year and week 1. I dont know how to properly reference it...
511 Jan 2015 @ 02:03 PSTDatabaseReplySyntax when concatenating string and numberThanks that is a lot cleaner than my origional code
411 Jan 2015 @ 01:09 PSTDatabaseReplySyntax when concatenating string and numberThanks again dieter, one more question; is there a way to make it return leading 0s instead of removing the blanks. For example store 10 returned as 010 or possibly 0010
311 Jan 2015 @ 07:15 PSTDatabaseTopicSyntax when concatenating string and numberI am trying to create new variables using a combination of text and numbers. I thought this was possible but do not know for sure. I am getting the following error dont know if its because im missi...
210 Jan 2015 @ 05:17 PSTDatabaseReplyHow to create a loopthanks all for the quick response  I used hemath's code my table didn't already have the weeks in ascending order which was causing it to sum up the sales in a non chronological order ...
109 Jan 2015 @ 05:39 PSTDatabaseTopicHow to create a loopI have a table that has 4 columns of Week Year and Cost of product A and cost of product B I need it to sum up the cost by year cumulativly up to that Week. For example in week 4 of 2014 i need it...