Archives

 

A few quick tips on CSS Styling

I found many posts regarding upgrading Dynamics GP through multiple versions and we are in the process of upgrading Dynamics GP from 2010 - 11.00.2351 (SP4)

I have installed and migrated data to 2015 - 14.00.0725 (R2) along with SmartLists and Extender

Then installed and migrated data to 2016 - 16.00.0901 (R2) again with SmartList and Extender

Before I go on to 2018 - 18.2.1013 ...

 

We also use Management Reporter.  I couldn't find much on migration jumps (like Dynamics 2010-2015-2016-2018).  What are my steps to get this product current with our Dynamics 2018?

 

Okay - I found a SQL Stored Procedure on internet (Credit to Jack Worthem) (A Better Way To Track User Activity In Dynamics GP (jackworthen.com)

that I have tweaked for my purposes.

I want a basic - log in, log out report - here's what I have so far:

USE [DYNAMICS]
------select * from track_activity_code 
DECLARE @userid VARCHAR(20), 
    @startdate DATETIME,
    @enddate DATETIME
    ----@action VARCHAR(100)
 
SET @userid = 'BronT'
SET @startdate = '8/01/2022'
SET @enddate = '8/01/2022'
----SET @action = '2'
--------select * from Sy05000 where USERID='BronT' and DATE1 >='2022-08-01' and inqytype='15'  
IF @UserID IS NULL 
BEGIN  
SELECT s.USERID AS 'User ID',
    m.USERNAME AS 'User Name',
    m.USRCLASS AS 'User Class',
    s.DATE1 AS 'Date',
    s.TIME1 AS 'Time',
    c.description AS 'Simple Description',
    s.SECDESC AS 'Detailed Description',
    s.CMPNYNAM AS 'Company Name'
FROM sy05000 s
    INNER JOIN track_activity_code c on s.inqytype = c.code
    INNER JOIN SY01400 m ON m.userid = s.userid 
WHERE s.date1 BETWEEN @startdate AND @enddate and c.code in ('15','2')
ORDER BY s.DATE1
END
 
ELSE IF @UserID IS NOT NULL 
BEGIN
SELECT s.USERID AS 'User ID',
    m.USERNAME AS 'User Name',
    m.USRCLASS AS 'User Class',
    s.DATE1 AS 'Date',
    s.TIME1 AS 'Time',
    c.description AS 'Simple Description',
    s.SECDESC AS 'Detailed Description',
    s.CMPNYNAM AS 'Company Name'
FROM sy05000 s
    INNER JOIN track_activity_code c on s.inqytype = c.code
    INNER JOIN SY01400 m ON m.userid = s.userid
WHERE s.date1 BETWEEN @startdate AND @enddate and c.code in ('15','2')
    AND s.userid = @userid
ORDER BY s.DATE1
END

Here's what my dataset looks like: 

First problem - the SY0500 table always has two identical records for the log out event. No idea why - maybe third party or something is writing a duplicate record. So, 6 rows really should be 4 rows. 

Secondly, not sure if I should just pivot the data in the stored procedure so that these 6 would be two records since we have two login's and two logouts.

Thirdly, not certain how I want to handle the way too often no log out situation. Any thoughts?

Has anybody done a nice clean query that shows time logged into GP, by user, each day.

Any guidance would be appreciated. 

 

What is Budget Status is invalid - budget status needs to be open?
From where in the data tables can I retrieve the last aging date used for RM?

I have a stored procedure which works great. I want to make the same identical query but against a different SQL database.

Can I do a UNION ALL? If so, how?

Create Procedure HCGBATCH


AS


DECLARE @TotalInvoices int
DECLARE @InvoiceDollars decimal(10,2)
DECLARE @TaxAmt decimal(10,2)
DECLARE @RevDollars decimal(10,2)
DECLARE @FeeDollars decimal(10,2)


BEGIN


SET NOCOUNT ON;


set @TotalInvoices =
(select(COUNT(DISTINCT SOP10200.SOPNUMBE)) from SOP10200
where SOPNUMBE like 'HCG%' and SOP10200.SOPTYPE='3')


set @InvoiceDollars =
(select (CAST(SUM(XTNDPRCE) as decimal (10,2))) from SOP10200
where SOPNUMBE like 'HCG%' and SOP10200.SOPTYPE='3')


set @TaxAmt =
(select (CAST(SUM(TAXAMNT) as decimal (10,2))) from SOP10200
where SOPNUMBE like 'HCG%' and SOP10200.SOPTYPE='3')


set @RevDollars = 
(select CAST(SUM(XTNDPRCE) as decimal (10,2)) from SOP10200
where SOPNUMBE like 'HCG%' and SOPTYPE='3' AND ITEMNMBR='REF-H-P')


set @FeeDollars = 
(select CAST(SUM(XTNDPRCE) as decimal (10,2)) from SOP10200
where SOPNUMBE like 'HCG%' and SOPTYPE='3' AND ITEMNMBR='REF-H-FEE')


select 
'USA' as Company,
@TotalInvoices as TotalInvoices, 
@InvoiceDollars as InvoiceDollars,
@TaxAmt as Tax, 
@RevDollars as RevenueDollars,
@FeeDollars as FeeDollars

END

 

 
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3