Sum sales query last 6 months
Hi people......
Using docdate and sum(quantity) how can i sum the last 6 months from today.??
select itemcode, sum(quantity) FROM oinv, inv1, oitm, oitb....... WHERE getdate() ?????
I hope explain correctly....
Hi,
Better use: DateDiff(DD,T0.DocDate,getdate()) >= 180
Thanks,
Gordon
Similar Messages
-
How to use the AGO function to calculate the sum of the last 12 months?
year | month | amount
2009 | 01 | 100
2009 | 02 | 150
2009 | 03 | 120
2009 | 04 | 110
2009 | 05 | 155
2009 | 06 | 180
2009 | 07 | 105
2009 | 08 | 145
2009 | 09 | 200
2009 | 10 | 205
2009 | 11 | 150
2009 | 12 | 120
2010 | 01 | 225
SUM OF THE LAST 12 MONTHS OF 201001=>225+120+150+205+200+145+105+180+155+110+120+150 *1.865*
How do I do this? Could anyone help me?
Thanks.hi,
Create a dummy column in Fx
Use *Filter ( amount_col using date col= TimeStampAdd(SQLTSI_MONTH, -12 ,date_col)*
If u want to show at grand total level
Go with combine with similar request
same as u mentioned (1st criteria)
date_col, month, use the above formula (2nd criteria)
try this and let me know
Thanks,
Saichand.v
Edited by: Saichand Varanasi on Oct 7, 2010 7:27 PM -
Customers without sales in last 6 months by sales group
How would you get the customers that had not placed an order in the last six months by sales group?
I was looking if in MCSI I could find something but no luck, I guess I will have to make a query on SQVI
Regards,
CarlosYou need to create a Z-Report or manually download data into excel and compare.
You need to sort out all customers based on sales group from table KNVV. Then check against orders created against those sales groups in last 6 months - the difference is te result.
There are two points to be taken care of -
1. All customers which was created in last 6 months but have not done any business - should be excluded from result
2. If sales group is put/changed manually in transaction (i.e. customer and sales order sales groupd are different) then the logic will not work properly - Sales group wise.
I had faced these problems in a similiar report, so just informing.
Thanks -
How to update sales of last 3 months only
I have a query which basically updates the sales for the whole year, but i just want that one to be changed such that it only updates for the past 3 months,irrespective
of the year ( i mean to say if i run it today it must update march,april,may of 2014 but if i run it on jan 2015 then it must update oct,nov,dec of 2014).
Below is my update statement
update tODS_GLBalance
set tODS_GLBalance.tUTL_JobLogging_Key = @tUTL_JobLogging_Key,
tODS_GLBalance.Balance = vODS_GLBalance.GLAmount,
tODS_GLBalance.ModifiedDate = GETDATE(),
tODS_GLBalance.ModifiedUser = SUSER_NAME()
From ODS.Staging.vODS_GLBalance
Left Outer Join Ods.JJill.tODS_GLBalance
ON tODS_GLBalance.FiscalYearId = vODS_GLBalance.FiscalYearId
AND tODS_GLBalance.FiscalMonthOfYearId = vODS_GLBalance.FiscalMonthOfYearId
AND tODS_GLBalance.Page = vODS_GLBalance.PAGE
Where
tODS_GLBalance.FiscalYearId = YEAR(GETDATE())
AND
tODS_GLBalance.FiscalMonthOfYearId = vODS_GLBalance.FiscalMonthOfYearId
AND tODS_GLBalance.FiscalYearId = vODS_GLBalance.FiscalYearId
AND tODS_GLBalance.Page = vODS_GLBalance.Page
AND tODS_GLBalance.Balance <> vODS_GLBalance.GLAmount
Can someone please help me with this, Please let me know if you have any questions or if i am unclear.
ThanksI suggest adding this line of code to the where clause:
AND
tODS_GLBalance.FiscalMonthOfYearId
in(month(dateadd(m,-1,getdate())),month(dateadd(m,-2,getdate())),month(dateadd(m,-3,getdate())))
This assumes that you are testing against the fiscalmonthofyear and that the fiscal periods are the same as calendar periods. Otherwise, there will be some adjusting to do.
This is basically checking to see if the fiscal monthofyearid is in the 3 most recent months.
/* If this helps, please click appropriately below. Thank you! */ -
Calculate sales for last 60 days
hello
want to make key figure or formula, which calculate sales for last 60 days, but also i need to add week group in report, so for each week i need sum sales for last 60 days before this ...
is any solution to that?
thank you.Alex,
I'm not very clear on what you are asking.
If you use your time parameters in selections you can use caldays and weeks with your key figures.
ie. Selection 1 has your key figure and calday restricted t the last 60 days.
Selection 2 has your key figure and Fiscal Week but I am not clear on the range required for fiscal week.
Regards
Gill -
Hi experts,
i have requirement to write end routine to read a DSO for last 12 months sales quantity for each month and sum value pass to keyfigure
not interested using bex variable, while data loading from source to target dso in end routine i am trying to read another DSO which is same as my
target dso where information is stored by fiscal period, year material etc. finally there is a keyfigure in target whih needs to be filled with sum of 12
months sales quantity, for each record form sourc to target maximum of 12 records will be in read dso (for 12 months) my routine is like below.
i am not expert in abap please kindly gothrough and guide me in this
TYPES: BEGIN OF s_/BIC/AZOSLS00,
FISCPER type /BI0/OIFISCPER,
FISCVARNT type /BI0/OIFISCVARNT,
PLANT type /BI0/OIPLANT,
STOR_LOC type /BI0/OISTOR_LOC,
/BIC/MATERIAL type /BIC/OIMATERIAL,
VTYPE type /BI0/OIVTYPE,
BILL_QTY type /BI0/OIBILL_QTY,
END OF s_/BIC/AZOSLS00.
DATA: it_/BIC/AZOSLS00 TYPE TABLE OF s_/BIC/AZOSLS00,
wa_/BIC/AZOSLS00 TYPE s_/BIC/AZOSLS00.
SELECT
FISCPER
FISCVARNT
PLANT
STOR_LOC
/BIC/MATERIAL
VTYPE
BILL_QTY
FROM /BIC/AZOSLS00 INTO TABLE it_/BIC/AZOSLS00
FOR ALL
ENTRIES IN RESULT_PACKAGE
WHERE
below field is from value of fiscal period (which is fiscal period -999 ex: for 001.2014 this
value will be 002.2013 so 12 months including current period)
FISCPER >= RESULT_PACKAGE-/BIC/ZFISCPERF
below is result filed fiscal period (here i dont know which keyword or statement to be used to select
interval values this between statement giving syntax error that can not be used in where for for all entries
between RESULT_PACKAGE-FISCPER
AND
FISCVARNT = RESULT_PACKAGE-FISCVARNT AND
PLANT = RESULT_PACKAGE-PLANT AND
STOR_LOC = RESULT_PACKAGE-STOR_LOC and
/BIC/MATERIAL = RESULT_PACKAGE-/BIC/MATERIAL .
SORT it_/BIC/AZOSLS00 BY FISCPER FISCVARNT PLANT STOR_LOC
/BIC/MATERIAL .
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
READ TABLE it_/BIC/AZOSLS00 INTO wa_/BIC/AZOSLS00 WITH KEY
below dont know what statement i need to use in read statement for interval of fiscal periods
giving error that >= can not be used
FISCPER >= <result_fields>-/BIC/ZFISCPERF
FISCPER = <result_fields>-FISCPER
FISCVARNT = <result_fields>-FISCVARNT
PLANT = <result_fields>-PLANT
STOR_LOC = <result_fields>-STOR_LOC
/BIC/MATERIAL = <result_fields>-/BIC/MATERIAL
BINARY SEARCH.
BREAK-POINT.
IF sy-subrc = 0.
below for each record there will be 12 records in read so sume of 12 records quantity i need to pass to result again dont know what to say here
sum statement giving error
<result_fields>-/BIC/ZLSTSLS12 =
sum(wa_/BIC/AZOSLS00-BILL_QTY).
ENDIF.
ENDLOOP.
friends please help me in this.
Thanks
Chandra.Hiii,
If you only want to store last 12 months data in Target ODS .
Then Create filter in DTP and write routine in filter for calmonth or fiscal period.
Refer the below link to create filter routine :
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80b2db87-639b-2e10-a8b9-c1ac0a44a7a6?QuickLink=index&…
Regards,
Akshay -
Hello All -
We use the below Query to find monthly sales for each of our stock units. However, it only provides the current year -- so for 2010, all our 2009 data is gone and the query just shows Jan 2010.
Is there any way to adjust this Query so that we can select the year we want to see?
Thanks!
Mike
SELECT T0.ITEMCODE,
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JAN Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'FEB Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 3 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'MAR Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 4 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'APR Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 5 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'MAY Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 6 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JUN Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 7 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JUL Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 8 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'AUG Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 9 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'SEP Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 10 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'OCT Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 11 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'NOV Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
(NOLOCK) WHERE MONTH(T1.DOCDATE) = 12 AND T1.ITEMCODE
= T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'DEC Amt'
FROM dbo.OITM T0
LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode
WHERE T0.SellItem = 'Y'
GROUP BY T0.ItemCode,YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = YEAR(GETDATE())
ORDER BY T0. ITEMCODE/*Hello there!!
you should try this code*/
SELECT T0.ITEMCODE, (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 1
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'JAN Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'FEB Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 3
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'MAR Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 4
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'APR Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 5
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'MAY Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 6
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'JUN Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 7
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'JUL Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 8
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'AUG Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 9
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'SEP Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 10
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'OCT Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 11
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'NOV Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 12
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'DEC Amt'
FROM dbo.OITM T0 LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode WHERE T0.SellItem = 'Y'
GROUP BY T0.ItemCode,YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1) ORDER BY T0. ITEMCODE
thou i suggest that its more practical for you to use a variable to enter the year, for example like this.
declare @year as char(4)
set @year = '2009'
SELECT T0.ITEMCODE, (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 1
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'JAN Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'FEB Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 3
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'MAR Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 4
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'APR Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 5
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'MAY Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 6
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'JUN Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 7
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'JUL Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 8
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'AUG Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 9
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'SEP Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 10
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'OCT Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 11
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'NOV Amt',
(SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 12
AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'DEC Amt'
FROM dbo.OITM T0 LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode WHERE T0.SellItem = 'Y'
GROUP BY T0.ItemCode,YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = @year ORDER BY T0. ITEMCODE -
Can I build a query to show monthly sales by item by business partner?
Hi all
Is it possible to build a query to show monthly sales (quantity not value) by item by business partner?
So the table would look something like this.
Jan Feb Mar Apr
Item 1 10 4 8 7
Item 2 4 3 5 6
Item 3 4 12 9 3
Item 4 1 0 1 2
Etc...
As you can see, the monthly figure needs to be quantity of the item and not sales value.
Would be grateful for any help.
Many thanks.
WendyHi,
Try this:
declare @code as varchar(15)
set @code = ( select max(ta.cardcode) from OINV ta where ta.cardcode = [%0])
Select [a] as Cardcode, [B] as Cardname, [c] as Item#, [D] as Descr,[1] as Jan,[2] as Feb,[3]as Mar,[4] as April,[5] as May,[6] as June,[7] as July ,[8] as Aug,[9] as Sept,[10] as Oct ,[11]as Nov,[12] as Dec
from(
SELECT T0.[CardCode] as A , T0.[CardName] as B, T1.[ItemCode] as C, T1.[Dscription] as D, sum(T1.[Quantity]) as t,month(T0.[DocDate]) as month FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE year( T0.[DocDate]) = 2014 and t0.cardcode = @code GROUP BY T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription],T0.[DocDate] ) S
pivot
(sum(t) for month IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P
Thanks & Regards,
Nagarajan -
Creation of a Query to show the values for the current month and the last 12 months data.
Dear All,
Good day!
I have to create a Query with the below requirement.
I have to create a Query to show the values for the current month and the last 12 months data.
Can you please guide me how to achieve this ??
thank you,
Regards,
HemaHema
explain the exact problem..? as you mentioned you want to create query to show values for current month and last 12 months.. so I think you want to show values for 12 months from current data.. you can achive this by multiple way..
you can have selection screen and field with date .. and restrict based on system current date and 12 months before or you can handle this at your target.. .. I mean there are multiple ways to restrict data by date range..
for some more hints..
http://www.forumtopics.com/busobj/viewtopic.php?t=34393&sid=7fba465d0463bf7ff5ec46c128754ed6
http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/how-to-display-last-12-months-in-report-based-on-todays-date-3231850
http://scn.sap.com/thread/3217381
search on SDN you will get many other ways..
Thanks,
Bhupesh -
Query to show items not used in last 12 months
Can anyone help with a query or is there a was in B1 to pull a report of item that have not had activity in the last 12 months?
I drilled into one item that I knew we are still using. The date on my inactive report was 01/01/07. This is what was displayed in inventory posting.
Posting Date Document Whse Qty Price after Disc. Balance
210070 1,329
1/2/2008 SO 3133 1 -560 $0.05 769
1/29/2008 ST 1 231 $0.05 1,000
1/31/2008 SO 3231 1 -585 $0.05 415
1/31/2008 SO 3235 1 -415 $0.05
2/7/2008 PD 2898 1 5,500 $0.00 5,500
2/8/2008 SO 3261 1 -642 $0.00 4,858
2/12/2008 PU 6801 1 $249.98 4,858
3/10/2008 SO 3429 1 -1,281 $0.05 3,577
3/19/2008 SO 3520 1 -1,335 $0.05 2,242
3/28/2008 PD 3065 1 5,500 $0.05 7,742
4/3/2008 PU 7204 1 ($0.27) 7,742
4/16/2008 SO 3756 1 -1,308 $0.05 6,434
5/2/2008 SO 3884 1 -1,265 $0.05 5,169
5/5/2008 SO 3946 1 -1,368 $0.05 3,801
7/10/2008 SO 4494 1 -643 $0.05 3,158
3,158 -
SQL query to get last 6 months records neglect the current month
Hi All;
I need help with
sql query to get last 6 months records neglect the current month
Any help much appreciated
Thanks
Pradnya07SELECT <> FROM tbl WHERE dt >=dateadd(month,-6,GETDATE())
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Calculate Last 12 months Sales
Hi Experts,
I need to have MAT value in Reporting.
MAT Value = Last 12 Months Sales Value/12.
How can i achieve this.
Please suggest the best way to have MAT value.
Thanks in advance,
RafiHi,
Create one restricted key fig by offsetting month for last 12 months and drag sales value key fig into that.
Now create a formula variable by dividing the newly created restricted key fig with 12.
hope it helps...
regards,
Raju -
Item Query by onhand/QTY Sold in last week/month/QTY
I am trying to create a query showing items that are in a particular warehouse and then how many of that item has been sold over the last week/month/quarter.
I have got the following query started,but i am unsure to group can anyone help with this
SELECT T0.[ItemCode], T0.[ItemName],T1.[OnHand], T0.[IsCommited], T0.[MaxLevel], T0.[MinLevel], T2.[Quantity]
FROM [dbo].[OITM] T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode INNER JOIN INV1 T2 ON T0.ItemCode = T2.ItemCode
WHERE T1.[WhsCode] = '01'I am trying to create a query showing items that are in a particular warehouse and then how many of that item has been sold over the last week/month/quarter.
I have got the following query started,but i am unsure to group can anyone help with this
SELECT T0.[ItemCode], T0.[ItemName],T1.[OnHand], T0.[IsCommited], T0.[MaxLevel], T0.[MinLevel], T2.[Quantity]
FROM [dbo].[OITM] T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode INNER JOIN INV1 T2 ON T0.ItemCode = T2.ItemCode
WHERE T1.[WhsCode] = '01' -
How to find top utilized query for last two months in oem
how to find top utilized query for last two months in oracle enterprise manager?
Can you mark the thread as Helpful and once marked the information can be reviewed by other customer for similar queries
Regards
Krishnan -
Subject: How to get a rolling window query of last 12 months?
Subject: How to get a rolling window of last 12 months?
I am developing a report on 0TCT_C21. I want to compare process chain execution time for every month for last twelve months to see a trending report.
How can I determine this information dynamically, i.e., when report is run, let us say in Dec 2009, it will show me 12 columns: Jan to Dec 2009, but if report was run in Dec 2010, it will show 12 columns results from Jan to Dec 2010.
Any information will be greatly appreciated.Hi,
Keep offset value-1, -2, -3, ... -11 for 0Calmonth.
Maybe you are looking for
-
Are you using Coolbits2 or NvTweak with your 6600GT?
Just found out that they both have options to turn off fast writes and sidebanding. Sandra tells me these are enabled on my system, yet I have no option for them in the bios. I was thinking about trying coolbits 2 to see if I could disable these 2 op
-
OWB 10.2 script OMB+ to list mapping operator type
Hi all, I'm using OWB 10gR2 and I want run an OMB+ script to list all operators (name and type) for all mappings in a project. With some loops in TCL, I can list mappings with OMBLIST MAPPINGS For each mapping, I can list operators with OMBRETRIEVE M
-
Having problems keeping Applet TV connected for file sharing, Will disconnect in the middle of watching a movie. Can anyone help and tell me how to keep the two devises communicating??
-
Screensaver on desktop background also when i work
hello. it is possible put screensaver on desktop background also when i work? how?using terminal?what line command? thanks for the help
-
WD Digital Harddrive Latest Model
I need a 2nd internal HD. I was thinking of a WD500. With all the different model letters, I am not sure which is the most current. I should get a SATA II model, correct? The Western Digital website is not so clear. I think the latest is the WD Cavia