Query for an ALERT to give items that haven't sold in 60 days
To the Experts.
Can someone help me with a query for an ALERT. I need items that haven't sold in the last 60 days?
Try this query.
select max(t1.docdate) as [Last Inv Date], t0.itemcode, t0.dscription
from inv1 t0 inner join oinv t1 on t0.docentry = t1.docentry
where t1.doctype = 'I'
group by t0.itemcode, t0.dscription
having max(t1.docdate) <= getdate() - 60
order by t0.itemcode
The value getdate() is today, so getdate() - 60 will move the filter date back 60 days. This looks at A/R Invoices and only Items type documents.
I hope this helps.
Ross Unger - Third Wave Business Systems
Similar Messages
-
Query for Inventory Account getting from Item Master
Hi,
I want to get Inventory Account from Item Master with the use of query.
I used below query for that.
SELECT T0.[ItemCode], T0.[BalInvntAc] FROM OITW
but it's give me the blank value for the Inventory Account.
Thanks & Regards,
Tushar NathwaiHi Gordon,
It's a Inventory - Finished Products (TRG)
But it's also not displayed in other database so what could be the reason for that?
Thanks & Regards,
Tushar Nathwani -
Query for Price difference account when item is not sold but not on stock
Hi Experts!
One of my clients accountant requires a report which will help for what to do with the balance of the price difference account.
At the and of the year there are some postings on this account, but not every item that hadnt been on stock when A/P Invoice arrived were sold. Some item were waistrel and put into a waistrel warehouse, but not sold.Some item were sent back to the supplier, but not sold.
Is it possibble to make a query for knowing where to post the balance of the price difference account? Not all should be post to the Cost of goods sold.
Thank you in advance!Hi,
The query is possible. However, it is a complicated one. It is also need to involve detailed analysis to your transaction histories. You may start from OINM table to check.
Thanks,
Gordon -
SQL query for custom alert view
I have created a custom alert view and scoped to show alerts related to group of servers.
Alert view Criteria: Resolution State - New, Severity - Warning and Critical, Group - "Group 1"
I am trying to query the Operations Manager database to show the alerts with same criteria using below query.
select MonitoringObjectName, ResolutionState, Priority, Severity, TimeRaised, TimeAdded, TimeResolved, AlertStringName, AlertStringDescription from AlertView where ResolutionState = '0' AND (Severity = '2' or Severity = '1')
AND
MonitoringObjectId IN (select TargetObjectId from RelationshipGenericView
where SourceObjectDisplayName = 'Group 1')
in Console i see both warning and critical alerts where as in SQL query output i see only critical alerts. Could you please correct if I am using wrong query. also please share your suggessions if i am completely wrong on this.
Kind Regards,
Bommi
~Bommiyour query looks perfectly fine. Are you sure if the alerts you see in the console are of the 'Resolution State =0' (New). It might be the case where the alert have moved to a fidderent resolution state.
Also, take a sample warming alert from console, query for the same in DB and check the Severity value. If it is '2'.
Regards,
Saravanan -
My Ipad 2 have frozen with itunes icon alot , I bring to apple store fix it alot , but bring home use only a week , ipad have same broblem again , I very tired and mad because I pay alot money for apple but they give me bad ipad , future I thing about samsung tablet . Now my ipad still have a problem I am very upset this ****.
For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices.
That all works.
It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now. They are all synced, and all was working just fine.
I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
Thanks for listening,
Melissa -
Listing (for further action) all page items that have a certain script label
hello from France,
Well the question is essentially in the subject line: how to find and work on all page items of a document (or a page/spread) that have the same script label (or better: whose script label contain the same word)?
I tried some variations around something like that, with no results:
set list_pageitems to every page item of page i whose label is "product"
Any clues?
Thanks for your help
VincentI found the answer (for those who might be interested), but still have a question (for those who know).
The solution:
set list_pageitems to page item "product" of page i
If you want to do it for a whose document (in may case, deleting some page items):
delete page item "product" of document 1
Strange syntax but it works :-)
The remaining question:
How to find page items whose label contains a certain string: it would be like selecting page items by tags (every word of the script label would be considered as a tag)?
Thanks -
Query for getting Outtanding Production Order items
Dear Experts,
With a query, please advice how I can get a list of outstanding Production Order items?
Much Thanks in Advance for your advice.
Warmest Regards,
ChinhoProduction Reports --->Open Item List --.> Production Orders
-
This only happens when I am typing an outgoing e-mail on my Yahoo account!
Please do the following.
Click '''Help '''| '''Check For Updates'''. The option to update should appear and version 3.6.17 should download and install.
However, sometimes things go pear-shaped and you get version 3.5.19. If that happens, repeat the same steps to update to 3.6.17.
Once you have 3.6.17 installed, you'll get the opportunity to update to the current version which is 4.0.1 ''Please don't do that for the moment because you first of all have to update your plugins''. To do the latter, please do the following.
Go to http://www.java.com/en/ and install the latest version of Java.
Update Adobe Shockwave for Director via http://get.adobe.com/shockwave/
Update Adobe Flash via http://get.adobe.com/flashplayer/
Update Adobe Reader via http://get.adobe.com/reader/?promoid=BUIGO
For security details regarding the Adobe updates, see: http://www.adobe.com/support/security/advisories/apsa11-02.html
Once you've updated all those, go to '''Help '''| '''Check For Updates '''again to update to version 4.0.1 -
Listing (for further action) all page items that have a certain custom label
Hi again,
Same question as before (see my previous post today), but now with custom labels.
Who has already use the custom labels and how?
I found it easy to write and read custom labels on a item basis (via a loop inside a list) but what if i want to get a list based on a custom label?
Thanks for any helpI found the answer (for those who might be interested), but still have a question (for those who know).
The solution:
set list_pageitems to page item "product" of page i
If you want to do it for a whose document (in may case, deleting some page items):
delete page item "product" of document 1
Strange syntax but it works :-)
The remaining question:
How to find page items whose label contains a certain string: it would be like selecting page items by tags (every word of the script label would be considered as a tag)?
Thanks -
A script that will query for the last successful backup to tape across all protected datasources
I've searched trying to locate an existing script for this and come up empty so far but essentially what I am trying to do is have a script I can run that will query for the latest backup to tape that succeeded for each data source across all of the protection
groups then output that time/date for each to a file.
I'm extremely new to scripting so I am unsure of how to go about getting started with this so any help would be greatly appreciated!this should work
foreach ($DS in $DSList)
$RP=$DS | Get-RecoveryPoint | where {$_.Location -eq "Media"} | Sort-Object -Property Backuptime -Descending | select -First 1 | select *
$Tape=Get-DPMTape -DPMLibrary $Library | where {$_.ID -eq $Rp.RecoverySourceLocations.MediaMapList.MediaId}
$obj = New-Object -TypeName PSObject
$obj | Add-Member Noteproperty -Name DatasourceName -value $DS.Name
$obj | Add-Member Noteproperty -Name Sourcecomputer -value $DS.Computer
$obj | Add-Member Noteproperty -Name BackupTime -value $RP.BackupTime
#$obj | Add-Member Noteproperty -Name Location -value $Tape.Location.tostring()
#$obj | Add-Member Noteproperty -Name Medialabel -value $Tape.Medialabel
#$obj | Add-Member Noteproperty -Name Barcode -value $Tape.Barcode.Value
$Array+=$obj
Seidl Michael | http://www.techguy.at | twitter.com/techguyat |
facebook.com/techguyat |
youtube.com/techguyat -
Customized Query for purchase register
Hi All,
I need a query for purchase register which gives excise information with biferication.
OPCH, PCH1, ORPC, RPC1 and IEI4
In excel reporter we get the purchase register report But excise amount does not come in that report.
So, I need Customised report for that.
Regards
Shashihi shashi,
SELECT M.DocNum AS 'AP Inv. #', M.DocDate as 'Date', M.CardName as 'Vendor Name',M.NumAtCard as 'Bill No. & Dt.',
(Select Sum(LineTotal) FROM PCH1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=-90 and DocEntry=M.DocEntry) as 'ED (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=-60 and DocEntry=M.DocEntry) as 'EDCS (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=7 and DocEntry=M.DocEntry) as 'HECS (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=10 and DocEntry=M.DocEntry) as ' CVD (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=5 and DocEntry=M.DocEntry) as ' Ser.Tax (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=6 and DocEntry=M.DocEntry) as 'CS on Ser.Tax (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=8 and DocEntry=M.DocEntry) as 'HECS_ST (Rs.)',
(Select Sum(LineTotal) From PCH3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
M.WTSum AS 'TDS (Rs.)',
M.DocTotal as 'Total (Rs.)'
FROM OPCH M LEFT OUTER JOIN PCH1 L on L.DocEntry=M.DocEntry
LEFT OUTER JOIN PCH4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
LEFT OUTER JOIN PCH5 J ON M.DocEntry = J.AbsEntry
LEFT OUTER JOIN PCH3 Q ON M.DocEntry = Q.DocEntry
WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') AND (T.TrgetEntry = ' ')
GROUP BY
M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
ORDER BY
M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
Jeyakanthan -
Trouble writing Query for Pivoting data from a table
I am having a little trouble writing a query for converting the below table data into a pivot data. I am trying to write a query for which if I give a single valid report_week date as input it should give me the data for that week and also provide two extra columns, one which gives the data of last week for the same countries and the second column which gives the difference of numbers in both the columns(i.e. COUNT - COUNT_LAST_WEEK).
REPORT_WEEK DIVISION COUNT
9/26/2009 country1 81
9/26/2009 country2 97
9/26/2009 country3 12
9/26/2009 country4 26
9/26/2009 country5 101
10/3/2009 country1 85
10/3/2009 country2 98
10/3/2009 country3 10
10/3/2009 country4 24
10/3/2009 country5 101
10/10/2009 country1 84
10/10/2009 country2 98
10/10/2009 country3 10
10/10/2009 country4 25
10/10/2009 country5 102
For example, if I give input as 10/10/2009, the output should be as give below.
REPORT_WEEK DIVISION COUNT COUNT_LAST_WEEK DIFFERENCE
10/10/2009 country1 84 85 -1
10/10/2009 country2 98 98 0
10/10/2009 country3 10 10 0
10/10/2009 country4 25 24 1
10/10/2009 country5 102 101 1
For example, if I give input as 10/3/2009, the output should be as give below.
REPORT_WEEK DIVISION COUNT COUNT_LAST_WEEK DIFFERENCE
10/3/2009 country1 85 81 4
10/3/2009 country2 98 97 1
10/3/2009 country3 10 12 -2
10/3/2009 country4 24 26 -2
10/3/2009 country5 101 101 0
Can anyone please shed some light on Query building for the above scenarios.
Thank you
SKP
Edited by: user11343284 on Oct 10, 2009 7:53 AM
Edited by: user11343284 on Oct 10, 2009 8:28 AMI assume there is no gap in report weeks. If so:
SQL> variable report_week varchar2(10)
SQL> exec :report_week := '10/10/2009'
PL/SQL procedure successfully completed.
with t as (
select to_date('9/26/2009','mm/dd/yyyy') report_week,'country1' division,81 cnt from dual union all
select to_date('9/26/2009','mm/dd/yyyy'),'country2',97 from dual union all
select to_date('9/26/2009','mm/dd/yyyy'),'country3',12 from dual union all
select to_date('9/26/2009','mm/dd/yyyy'),'country4',26 from dual union all
select to_date('9/26/2009','mm/dd/yyyy'),'country5',101 from dual union all
select to_date('10/3/2009','mm/dd/yyyy'),'country1',85 from dual union all
select to_date('10/3/2009','mm/dd/yyyy'),'country2',98 from dual union all
select to_date('10/3/2009','mm/dd/yyyy'),'country3',10 from dual union all
select to_date('10/3/2009','mm/dd/yyyy'),'country4',24 from dual union all
select to_date('10/3/2009','mm/dd/yyyy'),'country5',101 from dual union all
select to_date('10/10/2009','mm/dd/yyyy'),'country1',84 from dual union all
select to_date('10/10/2009','mm/dd/yyyy'),'country2',98 from dual union all
select to_date('10/10/2009','mm/dd/yyyy'),'country3',10 from dual union all
select to_date('10/10/2009','mm/dd/yyyy'),'country4',25 from dual union all
select to_date('10/10/2009','mm/dd/yyyy'),'country5',102 from dual
select max(report_week) report_week,
division,
max(cnt) keep(dense_rank last order by report_week) cnt_this_week,
max(cnt) keep(dense_rank first order by report_week) cnt_last_week,
max(cnt) keep(dense_rank last order by report_week) - max(cnt) keep(dense_rank first order by report_week) difference
from t
where report_week in (to_date(:report_week,'mm/dd/yyyy'),to_date(:report_week,'mm/dd/yyyy') - 7)
group by division
order by division
REPORT_WE DIVISION CNT_THIS_WEEK CNT_LAST_WEEK DIFFERENCE
10-OCT-09 country1 84 85 -1
10-OCT-09 country2 98 98 0
10-OCT-09 country3 10 10 0
10-OCT-09 country4 25 24 1
10-OCT-09 country5 102 101 1
SQL> exec :report_week := '10/3/2009'
PL/SQL procedure successfully completed.
SQL> /
REPORT_WE DIVISION CNT_THIS_WEEK CNT_LAST_WEEK DIFFERENCE
03-OCT-09 country1 85 81 4
03-OCT-09 country2 98 97 1
03-OCT-09 country3 10 12 -2
03-OCT-09 country4 24 26 -2
03-OCT-09 country5 101 101 0
SQL> SY. -
Hi All,
How to write a query for an alert to be generated 5 days before the document due date?
thanks
SV ReddyHi Everybody for your valuable suggestions.
When we execute this query in normal mode by going to user query menu, it returns some records that can be displayed on to the screen in a separate window. When you attach this query to an Alert, how the Alert will trigger ?
Is it when the query returns more than 1 record then the name of the Alert will display in the inbox of the user ?
OR
Is it the result of the query displayed in the window?
What will happen when this query returns 0 records ? means is that true the alert wont be triggerred ?
What is the base criteria that an alert take in to consideration when to send a popup to the specified users?
Please reply
Thanks -
Query for quotes not converted to Sales Orders
Hello,
I am relatively new to SAP B1 (little over a year now) and I am trying to build a query but I have no idea how to approach this one.
I am trying to find Sales Quotes not converted to a Sales Order. Sounds simple but here is where they start getting complicated. I need to specify a date range (normally a year but could be quarterly). Need to specify one or more items, groups, or vendors. Need to display our cost for each item on the quote(s).
Any help on this would be great. I have used the query wizard in the past with some success but this one is getting way out of my comfort zone.
Many thanks to all who have contributed to these discussions. It is nice knowing that I am not the only newbie around.
Keith HHi Keith.
Following a little query for your request.
Take note that query return only the ROWS of sales quote which are never converted in a sales order.
It means that if you have a sales quote whit 1 rows and 1000 unit, and you convert the quote in a order for 500 unit, the quote is considered converted in a order and not displayed
The cost is the price set in PRICE LIST 23 as you say in a your previous post.
SELECT
a.DocDate ,
a.DocNum,
a.CardCode,
b.ItemCode,
b.Quantity,
d.ItmsGrpNam,
b.Price as 'QUOTE_PRICE',
e.Price as 'COST'
FROM
inner join QUT1 b on a.DocEntry = b.DocEntry
inner join OITM c on b.ItemCode = c.ItemCode
inner join OITB d on c.ItmsGrpCod = d.ItmsGrpCod
inner join ITM1 e on b.itemcode = e.ItemCode
where
a.DocDate between [%0] and[%1]
and b.TargetType <> '17'
and b.ItemCode Like '%[%2]%'
and e.PriceList = '23'
EDIT:
In your first post you say
Need to specify one or more items, groups, or vendors.
Please explain what you means for
=> one or more items
in this point you can have some problem with the query manager...
Hope that help
--LUCA -
Query for Order recomendation from MRP.
Good evening,
Recommendations are saved for the Production and Purchase Order after MRP is done. New Production and/or Purchase Orders are created in Planned stages. We need a query for the Alert Management to the users for the new Orders created.
Please can anyone guide and help me.
thank you.Hi,
Welcome you post on the forum.
Try this for production order:
SELECT T0.DocNum, T0.ItemCode FROM OWOR T0
WHERE T0.OriginType = 'R' AND DateDiff(dd,T0.DocDate,GetDate())=0
Thanks,
Gordon
Good Morning Sir,
Thanks for your message, guidance and support for the query.
The query for the alert for Production is working fine, we just changed the DocDate to PostDate as the Production Order, Posting date is as PostDate.
We tried to change the OWOR to OPOR and the Origin type to T0.Comments='Origin :MRP' and tried for Purchase Order, but the alert is not visible. Would it be ok, that we create an UDF and try the same?.
thanks and warm regards.
Maybe you are looking for
-
ITunes sync with multiple computers
Help for a newbie please! I have a Windows 7 laptop running iTunes and syncing up with my iPhone beautifully. My goal is to sync that library with another computer (Windows XP desktop) so that they're independent of one another. However, I do need
-
Delete sales order from MD04 screen
Hi Gurus, Need help in deleting a sales order from the MD04 screen. The sales order was deleted, there are no production order/reservations associated with this Sales order, the sales order is still appearing on the md04 screen and consuming the stoc
-
Hi How do I modify object type without droping table containing that object? Thanks a lot
-
Review Quiz Goes to the Beginnig of the Course vs. the Quiz
I have a course that contains several content slides and 10 question slides. When the user completes the quiz and clicks the Review Quiz button, Captivate takes them back to the very first slide in the course vs. to the first question slide. How can
-
Metadata or hotspot with link, when i clik on 3D part, it is possible?
is there a way to put a link in metadata or hotspot? with SAPlink? hotspot are valid only for 2d? not 3D? if i use the note it's ok, cgm ok... in VEAuthor it is possible to add a metadata or hotspot with link to another file on web or local system? w