473,385 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Selecting a specific value from an audit log

maxamis4
295 Expert 100+
Hello folks need some ideas here for a report that I am getting together. Here is the scenerio, currently we have an SLA that states that an external group transferring a problem to the internal group can qualify this problem as First resolve. Normally I would just grab the first row that has external to internal but the groups are nothing alike and there are multiple entries in the problem. Here is an example of my data from my audit table.

Expand|Select|Wrap|Line Numbers
  1. Problem number   TransMeth   Date              before_val    After Val
  2. 1009             GROUP      9/1/2009 2:15PM   Beta-Group    Alpha-Group
  3. 1009             GROUP      9/1/2009 2:45PM   Alpha-Group   INT-Group1
  4. 1009             GROUP      9/1/2009 3:42PM   INT-Group1    Alpha-Group
  5. 1009             GROUP      9/1/2009 3:50PM   Alpha-Group   Beta-Group
  6. 1009             GROUP      9/1/2009 4:15PM   Beta-Group    INT-Group2
  7. 1009             GROUP      9/1/2009 5:00PM   INT-Group2    Beta-Group
  8.  
  9.  
First let me add some quick notes. My internal groups have a unique identifier in them as shown in the example (INT) being this identifier. What I want to gather from this is how to get the first transfer date where External group (Alpha Beta) goes to Internal group (INT). Ideally here I would use the min (date) function to return the first record. But I need to ensure that this is the first transfer of this nature.


Looking at the example below you see that my internal group goes to my external group. This nullifies my original objective and this record can not be used. But based on my logic above I would still return a value which would be an incorrect value to return. I only need to return values that have the distinct criteria of transferring from external to internal as the first internal entry.

Expand|Select|Wrap|Line Numbers
  1. Problem number   TransMeth   Date              before_val    After Val
  2. 1009             GROUP      9/1/200911:01AM  INT-Group1     Beta-Group
  3. 1009             GROUP      9/1/2009 2:15PM   Beta-Group    Alpha-Group
  4. 1009             GROUP      9/1/2009 2:45PM   Alpha-Group   INT-Group1
  5. 1009             GROUP      9/1/2009 3:42PM   INT-Group1    Alpha-Group
  6. 1009             GROUP      9/1/2009 3:50PM   Alpha-Group   Beta-Group
  7. 1009             GROUP      9/1/2009 4:15PM   Beta-Group    INT-Group2
  8. 1009             GROUP      9/1/2009 5:00PM   INT-Group2    Beta-Group
  9.  
  10.  
I hope this makes since. I was toying with a count statement or a min(date) statement that captures the first date and compares it to the values returned buy I am having no luck and just need to be pointed in the right direction
Dec 23 '09 #1
2 1259
ck9663
2,878 Expert 2GB
Based on your 2 samples, what would be the returned data sets?

--- CK
Dec 23 '09 #2
maxamis4
295 Expert 100+
Statement one

Expand|Select|Wrap|Line Numbers
  1. 1009             GROUP      9/1/2009 2:45PM   Alpha-Group   INT-Group1
Statement two


I should get no results since the transfer went to a non INT group. The problem is that it came back and in this case it should not be counted. My results are
Expand|Select|Wrap|Line Numbers
  1. 1009             GROUP      9/1/2009 2:45PM   Alpha-Group   INT-Group1
  2.  
Dec 24 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Raphael Gluck | last post by:
Hi, Is it possible for one to program one's pages as such that when a database table is updated over the web, via a form, that an e-mail confirmation is sent to a specified address, notifying...
3
by: Simon G Best | last post by:
Hello! The C++ standard library provides facilities for finding out the sizes (and other such stuff) of numeric types (::std::numeric_limits<>, for example). What I would like to do is to...
1
by: xanuda | last post by:
Hi all: I want to audit a truncate command on just three tables in a database. I have been reading ORacle manuals and books, but I can't see how to do that, I can turn on auditing for ALL...
3
by: Zlatko Matić | last post by:
Hello. I tried to implement audit trail, by making an audit trail table with the following fileds: TableName,FieldName,OldValue,NewValue,UpdateDate,type,UserName. Triggers on each table were...
1
by: Nancy Shelley | last post by:
Hi all: I am building a navigation menu using telerik's rad treeview I am able to build the outer menu but not the children. How do I select the child nodes (item) from within the loop? Any...
1
by: Byrocat | last post by:
We're going to be enabling the audit facility on some of our DB2 servers in the future, and I need some basic information on how large I can expect the log to grow. I've already been warning NOT...
3
by: Beowulf | last post by:
I have the following function(s) that each joins an active record with it's most recent record in an audit trail table, to show differences. I've perused the execution plans for 2 versions of this...
7
by: aj | last post by:
DB2 LUW 8.2 FP5 (or is it 8.1 FP11?) I am CALLing a stored procedure from a trigger in order to maintain a column-level audit trail. Not only do I need to store a record of the INSERT, but also...
0
by: Jabba007 | last post by:
I have an update trigger on a table called 'tbl_br' that is used to audit column changes and populate those changes into an audit table called 'tbl_audit'. See an excerpt of the code below: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.