How to get Start Time of currently running SSRS Subscriptions - ssrs-2017

Can anyone help me in getting the currently running SSRS Subscription report Start Time.
I queried dbo.Notifications table, but the columns NotificationEntered , ProcessStart and ProcessAfter is quite confusing.
Please help.
Thank you

Try this below query to get running subscription details
select c.ItemID as ReportId,
c.Name,
c.Path,
s.SubscriptionID,
s.LastStatus,
s.LastRunTime,
s.DeliveryExtension
from ReportServer.dbo.Subscriptions s
inner join ReportServer.dbo.Catalog c
on s.Report_OID=c.ItemID
where s.LastStatus like '%Pending%'
LastRunTime column is subscription start time.
LastStatus column is status description of subscription.

Related

Not getting all events with session info

Does anybody know how to be sure that all the events get the 'ga_session_number' and 'ga_session_id' parameters with firebase?
Right now I'm getting only a 3% of the total events with those parameters and it should be on every event. Last sdk version is loaded on the app.
Thanks in advance for the help
The query I'm making is the following:
SELECT
user_pseudo_id, event.value.int_value session,
MIN(event_previous_timestamp), MAX(event_previous_timestamp),
MAX(event_timestamp) - MIN(event_timestamp),
COUNT(*)
FROM
`table`,
UNNEST(event_params) AS event
WHERE
event.key = 'ga_session_number'
GROUP BY
1, 2
ORDER BY
2
The total event rows on the table are more than 3 million, and getting only 100k with the query.
UPDATE:
Firebase support team has updated the analitycs SDK solving this issue.

Database table in which WTPart or Change activity Maturity History is stored

I need to pull the date on which a WTPart was in inwork state or A CN was in published state.
I did my analysis and found that there should be a Maturity history table in database, but i ended up with a table called MaturityBaseline table which does not hold this information. I need guidance on which table this information is stored. Even in API com.ptc.windchill.enterprise.history.HistoryTablesCommands.maturityHistory(wtObject); they are using Maturity History class.
Have you tried this method from same class?
com.ptc.windchill.enterprise.history.HistoryTablesCommands.getLegacyLifeCycleHistory(LifeCycleManaged arg0);
I have never tried by myself though. Also check for HistoryRecord table in database whether it have any info related to this.
I know this question is may years old now, but I stumbled across it looking at how to find the history of a change issue/problem report.
My problem report has a number TA00025 and I want to find when it was completed. The enter_phase action will tell me whenever the state has changed. This SQL will tell me changes of state for the nominated change issue/problem report (the same object type in Windchill)
select LH.action, LH.state, LH.updateStampA2
from wcadmin.[wcadmin].ObjectHistory OH, wcadmin.[wcadmin].LifeCycleHistory LH,
wcadmin.wcadmin.WTChangeIssueMaster CIM, wcadmin.wcadmin.WTChangeIssue CI
where OH.idA3A5 = CI.idA2A2
and OH.idA3B5 = LH.idA2A2
and CI.idA3masterReference = CIM.idA2A2
and CIM.WTCHGISSUENUMBER = 'TA00025'
and LH.action = 'Enter_Phase'
For a WTPart the history all sits in the table WTPart which will have a full history for a part wth multiple records.

asp.net multi-row update with gridview control without looping (vb.net)

I'm pretty new to asp.net. I'm building my first real app as a test. using SQL Server 2008 RS, VS Express 2012, IIS7.x and asp.net4.0
We receive Fedex shipment info every night that gets inserted into an MSSQL DB using SSIS. We then import the invoice, do variance matching and book costs to jobs based on the job no in Ref1 field. All this works great. However, the shipping department are supposed to put the ONLY the JobNo in the ref1 field. Of course they don't and there a lot of temps and shipping stations, so we need to fix the data. They'll put JobNo followed by junk, or junk and then the job no. When the costing people are looking at the invoice it's usually obvious what the job no is (e.g. "Samples for job 123" should be "123"). There can be many rows with the same Ref1 that needs editing (e.g 20 cartons with same Ref1). I have an SP with 3 params (OldRef, NewRef, invNo) that updates the Ref no for all records on that invoices:
UPDATE InvoiceLines
SET REF1 = #NewRef1
WHERE InvNo = #InvNo and Ref1 = #OldRef1
I figured a GridView (with an sqldatasource) would be a nice way to present the data. I only show rows where the Ref1 field is invalid, as the user corrects them, the no of records reduces.
I want the user to select a row, edit the Ref1 value and I'd just get the (old) RefNo of the selected row, it's new value, and call my SP with those and the InvNo (from a DropDown that filtered the invoice lines table).
Turns out to be way more difficult/inefficient that I thought.
All the examples I found to do this type of thing, make the user click all the rows and them loop through every row to do an update. Talk about slow and painful. I want to execute a single SP and have all matching rows updated and then refresh the list.
So what I'd like to figure out is how to get the OLD Ref1 (value in Ref1 before the edit - like deleted in an SQL trigger), the NEW Ref1 (edited value that the user typed in Ref1 - like inserted in an SQL trigger) and execute my SP and then refresh the table with the updated value result set.
Am I better off with something other than a grid view, or just using something other than the built in Edit command?
If I do figure out how to do the update, how do I refresh the GridView.
Can anyone point me in the right direction?
On another note, I'm on the fence about switching to C#. Most of the examples I'm finding are in C#. I learned C++ many years ago and read up on C# at weekend. It doesn't seem too difficult. I did find a Microsoft white paper and it pretty much said there's little difference between VB and C# so no real reason to switch. My colleagues do not know C or C#, so I'm just a bit concerned that in the unlikely event they need to help out, they'll be stuck. Any thoughts on this?
Regards
Mark

After join, cannot filter by attribute qty - getting products from inventory that are in stock

You have been so helpful in the past that I keep coming back searching for help and learning.
This time I am trying to get all products that have a quantity greater than 1 and that are in stock (is_in_stock = 1)
$products = Mage::getModel('catalog/product')->getCollection();
//$products->addAttributeToSelect('*');
//SELECT `e`.*, `stock`.`qty` FROM `catalog_product_entity` AS `e` LEFT JOIN `cataloginventory_stock_item` AS `stock` ON stock.product_id = e.entity_id
$products->getSelect()->joinLeft(
array('stock'=>'cataloginventory_stock_item'),
'stock.product_id = e.entity_id',
array('stock.qty', 'stock.is_in_stock')
);
This returns qty and is_in_stock columns attached to the products table. You can test it as follows:
$products->getFirstItem()->getQty();
$products->getFirstItem()->getIsInStock();
The issue begins when I try to filter by qty and is_in_stock.
$products->addFieldToFilter(array(
array('Qty','gt'=>'0'),
array('Is_in_stock','eq'=>'1'),
));
This returns - Invalid attribute name never performing filtering. I am guessing it is trying search for e.qty but cannot find it.
So, I tried to filter differently:
$products->getSelect()->where("`qty` > 0");
$products->getSelect()->where("`is_in_stock` = 1");
This is not filtering as well even though, if you look at its sql query, (var_dump((string) $products->getSelect())), and run that query in phpMyAdmin, it works.
Alan Storm in his tutorial mentions that 'The database query will not be made until you attempt to access an item in the Collection'. So, I make the $products->getFirstItem() call but it still not executing the query or filtering in another words.
What am I doing wrong? Any ideas how to filter by attributes that are joined to the table?
Thank you again,
Margots
I would suggest that you try using $products->addAttributeToFilter... instead of $products->addFieldToFilter... - the addField method only works when the field is on the main table that you are querying (in this case catalog_product_entity). Because the inventory fields are in a joined table, you need to use addAttribute.
Hope this helps,
JD
After looking under the hood I learned that _selectAttributes instance field was not assigned in Mage_Eav_Model_Entity_Collection_Abstract class and that is why get exception. A solution usually would be what Jonathan Day suggested above - add addAttributeToFilter() method, however. It will return error since it cannot find such attribute for catalog/product. (qty and in_invetory are in cataloginventory_stock_item). I found two solutions to my problem both required going different direction:
One involved pursuing a way to query the Select statement that I had set for product collection(see above) but somehow it was not resetting the collection with new product. WhenI copied that Sql statment in phpMyAdmin, it worked, so how to query that statement from product collection:
$stmt = $products->getConnection('core_write')->query($products->getSelect()->__toString());
while($rows = $stmt->fetch(PDO::FETCH_ASSOC)){
echo "<br>Product Id ".$rows['entity_id'];
}
Instead of using catalog/product entity table I used the flat table - cataloginventory_stock_item to accomplish the same thing
$stockItem = new Mage_CatalogInventory_Model_Stock_Item();
$stockItems->addQtyFilter('>',0);
$stockItems->addFieldToFilter('is_in_stock',array('eq'=>'1'));
Now there is a collection of all products with qty > 0 and that are in stock.

Inserting invoice transactions with Dynamics AX / Axapta Business Connector

G'day,
OK, I have now rewritten this question totally:
I am trying to import data into Dynamics through the use of the Business Connector (ideally, I would be importing it directly through SQL but I understand that is not a good idea - however I am open to other suggestions). This is to import invoices from a production system into Dynamics / Axapta (v5).
I can code to insert data into the CUSTINVOICETABLE table, which works fine and generates the RECID. However, new invoices just inserted exist without an Invoice ID (until they are posted I understand). However, I need to insert line items into the CUSTINVOICETRANS table as children of the above entry. For this you need to set the INVOICEID field to refer the above as the link to the parent. However, this does not appear possible before the invoice has been posted. Or I may be way off track?
Does anyone have any ideas or can shed any light for me? That would be much appreciated.
Regards,
Steve
To post a "Free text invoice" simply call custPostInvoiceJob.run() method.
You will have have to make the object first, then call a method with your newly created CustInvoiceTable record.
In X++:
custPostInvoiceJob = new CustPostInvoiceJob();
custPostInvoiceJob.updateQueryBuild(custInvoiceTable);
custPostInvoiceJob.run();
You will have to translate that into Business Connector calls in your preferred language.
Ok, it's actually as easy as it should be.
After the insert statement, simply use the get_Field call:
axRecord.Insert();
recID = (long)axRecord.get_Field("RECID");
You insert the line items in the CUSTINVOICELINE table (which uses a PARENTRECID), then upon posting the items get inserted into the CUSTINVOICETRANS table linked to the appropriate invoice number.
I hope this saves someone from having to work this out themselves.
Steve

Resources