Query Required To Get the datetime of insertion of row..urgent
Hi all,
i'm in great need to know if i can get the datetime of the rows inserted. please note that no audit trail neither db level or application level exists. i just want to know whether we can get to know which data has been inserted/updated during a month. because ultimately, the job is to find the rate of growth of data in a table in every month so as to plan for storage for next 5 months.
thanx in advance
Hi,
you can Tracl these things by Columns like inserted_date and Modified Date to the tables.
So when ever the New Data is Inserted into the respective columns and Updated The Modified Date Column Whenever the data is Updated.
You can track by above method..
Thanks
Pavan Kumar N
Similar Messages
-
SQL query to get the Datetime 06 hours prior to the table Datetime value
Hi Experts,
I'm just trying to create a SQL query to get the Datetime which should be 06 hours prior to my Table column value(Executiontime),
Eg: my Executiontime(column) value is 07:00AM means, this query should fetch the detail of first VMName from table at 01:00AM,
SQL Table Name: TestTable
Columns: VMName(varchar),status(varchar) Executiontime(Datetime)
SQL Query : Select Top 1 VMName from
TestTable where convert(date,Exeutiontime)=convert(date,getdate()) and
status='0' and ExecutionTime > dateadd(hour,6,getdate())
Request someone to alter this Query to my requirement or give me the new one.
Regards,
Sundar
SundarHi All,
Thanks for your Prompt response. I tried the below queries, but still I don't have any luck. Actually the queries are returning the value before the condition met (say when the time difference is more than 06 hours). I want the
query to return exactly @ 06 hour difference or less than 06 hours,
Query 01: Select Top 1 VMName from TestTable where
convert(date,Exeutiontime)=convert(date,getdate())
and status='0'
and ExecutionTime >
dateadd(hour,-6,getdate())
Query 02: Select
Top 1 VMName from TestTable where
status='0'
and ExecutionTime >
dateadd(hour,-6,getdate())
Query 03: Select
Top 1 VMName from TestTable where status='0'
and ExecutionTime >
dateadd(hour,-6,ExecutionTime)
Can someone point out the mistake please.
Regards,
Sundar
Sundar -
Requirement for getting the VAT Taxes automatically from the vendor invoice
Dear All,
We Have a Requirement for getting the VAT Taxes automatically from the vendor invoice in to the Sales invoice after invoice verification process.Is this feasible?. Can anybody explain how this can be done to overcome this issue.
Thanking you,
Best regards,
R.Srinivasanhi,
technically i do not think tht can be done. but even from functional part its incorrect in the sense tht the values on which tax is calculated in purchase may be very different from tht in sales. so we may never get the correct picture.
saurabh -
How to get the last transaction in a row in SQL Developer?
What syntax would I use to get the last transaction of a row in SQL developer?
The way I have my query set-up currently it is not returning the correct data, here is my current syntax:
select ssn, max(tran_id), chng_type,tran_id
from pda_tran
where ssn = 'xxx-xxx-0011'
and chng_type = 'C'
group by ssn, chng_type,tran_id;
It returns a 'C' chng_type but it is not the last one. when I query on this ssn this is what I get:
ssn tran_id chng_type
xxx-xxx-0011 001 A
xxx-xxx-0011 002 E
xxx-xxx-0011 003 C
xxx-xxx-0011 004 S
xxx-xxx-0011 005 C
xxx-xxx-0011 006 T
I only want to return the ssn's with a last transaction chng_type of 'C'. How can I get the correct information returned. Please advise.From what I see and read... there is one to many group by
You wrote
select ssn, max(tran_id), chng_type,tran_id
from pda_tran
where ssn = 'xxx-xxx-0011'
and chng_type = 'C'
group by ssn, chng_type,tran_id;
If you want the max(tran_id), remove it from the "group by"
select ssn, chng_type, max(tran_id)
FROM
(SELECT 'xxx-xxx-0011' ssn, '001' tran_id, 'A' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '002' tran_id, 'E' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '003' tran_id, 'C' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '004' tran_id, 'S' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '005' tran_id, 'C' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '006'tran_id, 'T' chng_type FROM DUAL )
where ssn = 'xxx-xxx-0011'
and chng_type = 'C'
group by ssn, chng_type; -
Getting the MD5 of an entire ROW ?
Hi All,
I'm looking for how to get the MD5 of an entire row (or a known set of columns).
I've found the DBMS_OBFUSCATION_TOOLKIT.MD5 function, which takes either "input IN RAW" or "input_string IN VARCHAR2" as a parameter.
So, I've three questions:
1) Is is possible to get the entire value Row in a manner to pass into this function? (e.g. As a String)
2) Is this DBMS_OBFUSCATION_TOOLKIT package only in Enterprise edition and not in Standard edition ? (How do I check this)
3) or Is there a better way to get the MD5 of a Row ??
My row of data will contain a column of type MDSYS.SDO_GEOMETRY.
Cheers,
RonanStill no luck with that one...
select DBMS_OBFUSCATION_TOOLKIT.MD5( input_string => TO_CHAR( ROUTEN ) ) ) AS MD5 FROM interstates;
ERROR at line 1:
ORA-00907: missing right parenthesis
I've seen examples, using that input_string, but only in a procedure, I can't get it to work through a standard SQL statement.
For example:
SQL> SET SERVEROUTPUT ON;
SQL> BEGIN
2 DBMS_OUTPUT.PUT_LINE (
3 'md5 hash => ' ||
4 DBMS_OBFUSCATION_TOOLKIT.MD5 (
5 input => UTL_RAW.CAST_TO_RAW ('plain text'))
6 );
7 END;
8 /
md5 hash => 31BC5C2B8FD4F20CD747347B7504A385
PL/SQL procedure successfully completed.
SQL> SELECT DBMS_OBFUSCATION_TOOLKIT.MD5 ( input => UTL_RAW.CAST_TO_RAW ('plain text')) FROM DUAL;
SELECT DBMS_OBFUSCATION_TOOLKIT.MD5 ( input => UTL_RAW.CAST_TO_RAW ('plain text')) FROM DUAL
ERROR at line 1:
ORA-00907: missing right parenthesis -
Getting the background color from a row
I'm displaying a table that has alternating row colors for odd and even... when I click on a row I am changing the color to blue. When I click on a different row I want to set the background color back to what it was for the originally selected row and change the currently selected row to blue. This worked just fine when I had the colors hard coded into the code... but as soon as I started using style sheets it stoped working,
My questions is how do I get the background color from a row... for instance, the following alert dislays nothing. How can I get the actual color out for the row?
var tableElem = document.getElementById('table');
var rowElem;
rowElem = tableElem.rows[0];
alert(rowElem.bgColor);
If you're working with style sheets, then ignore the background color. You don't want to care what color is actully being used, only that the correct style is in place.
Worry instead about the className property for your row:<style>
.highlightRow {
color: white;
background-color: gray;
.normalRow {
color: black;
background-color: white;
</style>
var tableElem = document.getElementById("table");
var rowElem = tableElem.rows[0];
alert(rowElem.className);
<table id="table">
<tr class="normalRow"><td>...</td></tr>
<tr class="highlightRow"><td>...</td></tr>
</table> -
Hello everyone,
I am using the following MDX query on one of my SSRS report.
SELECT NON EMPTY { [Measures].[Days Outstanding], [Measures].[Amt] } ON COLUMNS,
NON EMPTY { ([Customer].[Customer].[Customer Key].ALLMEMBERS) }
HAVING [Measures].[ Days Outstanding] > 60
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM ( SELECT ( STRTOSET(@Location, CONSTRAINED)) ON COLUMNS
FROM ( SELECT ( {[Date].[Fiscal Period].&[2014-06]}) ON COLUMNS
FROM [Model]))
Over here, the data is being filtered always for current month and for a location that is being selected by user from a report selection parameter.
I would like to get the count of total no. of customers and sum of the amount measure.
When I am using them in calculated members it gives incorrect values. It considers all records (ignores the sub-select statements) instead of only the records of current month and selected location.
I also tried with EXISTING keyword in calculated members but there is not difference in output. Finally, I manage the same at SSRS level.
Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
Any help would be much appreciated.
Thanks, Ankit Shah
Inkey Solutions, India.
Microsoft Certified Business Management Solutions Professionals
http://www.inkeysolutions.com/MicrosoftDynamicsCRM.htmlCan anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
Hi Ankit,
We can use SUM function and COUNT function to sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension. Here is a sample query for you reference.
WITH MEMBER [measures].[SumValue] AS
SUM([Customer].[Customer].ALLMEMBERS,[Measures].[Internet Sales Amount])
MEMBER [measures].[CountValue] AS
COUNT([Customer].[Customer].ALLMEMBERS)
MEMBER [Measures].[DimensionName] AS [Customer].NAME
SELECT {[Measures].[DimensionName],[measures].[SumValue],[measures].[CountValue]} ON 0
FROM [Adventure Works]
Besides, you ask that does it make any difference if I manage it as SSRS level and not at MDX query level. I don't thinks it will make much difference. The total time to generate a reporting server report (RDL) can be divided into 3 elements:Time to retrieve
the data (TimeDataRetrieval);Time to process the report (TimeProcessing);Time to render the report (TimeRendering). If you manage it on MDX query level, then the TimeDataRetrieval might a little longer. If you manage it on report level, then the TimeProcessing
or TimeRendering time might a little longer. You can test it on you report with following query:
SELECT Itempath, TimeStart,TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
TimeDataRetrieval, TimeProcessing, TimeRendering, ByteCount, [RowCount],Source
FROM ExecutionLog3
WHERE itempath like '%reportname'
Regards,
Charlie Liao
TechNet Community Support -
hi
i need to a query to get the data as per given structure below.
tha data should be based on stock code and dates.
for example : stock_code = 01 and
from date 01/01/08
to date 31/01/08
Date particulars reciepts issued returns closing bal
01/01/08 opening balance 0
01/01/08 recieved stock : no 1 18 18
02/01/08 issued stock : no 5 5 13
03/01/08 return stock : no 50 3 16
and so on
here is the tables i m using
SQL> desc bal_sheet (balance sheet holds the opening and closing record)
Name Null? Type
BDATE DATE
ACC_CODE VARCHAR2(20)
OPENBAL NUMBER(20,4)
CLOSEBAL NUMBER(20,4)
SQL> desc stock_reg
Name Null? Type
STOCKCODE NOT NULL VARCHAR2(20)
ITEM_CODE VARCHAR2(10)
DESCR NOT NULL VARCHAR2(50)
COMCODE VARCHAR2(6)
COMPANY NOT NULL VARCHAR2(200)
SHORT_NAME VARCHAR2(10)
PACK VARCHAR2(10)
PRICE NUMBER(10,4)
TOTAL_STOCK NUMBER
SQL> DESC PURCHASE_HEADER
Name Null? Type
P_ID NOT NULL VARCHAR2(10)
ACC_CODE VARCHAR2(10)
P_DATE DATE
REMARK VARCHAR2(500)
INVOICE_DATE DATE
NTOTAL NUMBER(12,4)
SQL> DESC PURCHASE_DETAIL
Name Null? Type
STOCKCODE VARCHAR2(20)
P_ID VARCHAR2(10)
QTY NUMBER
BONUS NUMBER
PRICE NUMBER(15,4)
EXPIRE_DATE DATE
DAMAGE NUMBER
AMOUNT NUMBER(15,4)
SQL> DESC SALES_HEADER
Name Null? Type
S_ID NOT NULL VARCHAR2(8)
ACC_CODE VARCHAR2(10)
SALES_MANID VARCHAR2(20)
S_DATE DATE
REMARKS VARCHAR2(500)
NTOTAL NUMBER(12,4)
SQL> DESC SALES_DETAIL
Name Null? Type
S_ID NOT NULL VARCHAR2(8)
STOCKCODE NOT NULL VARCHAR2(20)
QTY NUMBER
BONUS NUMBER
BATCH_NO NOT NULL VARCHAR2(10)
EXPIRY_DATE DATE
AMOUNT NUMBER(15,4)
SQL> DESC SALES_HEADER
Name Null? Type
SR_ID NOT NULL VARCHAR2(8)
ACC_CODE VARCHAR2(10)
SALES_MANID VARCHAR2(20)
S_DATE DATE
REMARKS VARCHAR2(500)
NTOTAL NUMBER(12,4)
SQL> DESC SALES_DETAILR
Name Null? Type
SR_ID NOT NULL VARCHAR2(8)
STOCKCODE NOT NULL VARCHAR2(20)
QTY NUMBER
BONUS NUMBER
BATCH_NO NOT NULL VARCHAR2(10)
EXPIRY_DATE DATE
AMOUNT NUMBER(15,4)
hope the information would be enough to get understand the problemQuery required to get data Agreed ! Even on your side it is required.
Well, please, understand we are not here to do your job. So, make effort on your side, show us what you have already done/tried, and post here your results.
And also, use the tags [pre] and [/pre] around your code against the forum side to keep your post readable.
Help us to help you,
Nicolas. -
Af:query - How to get the result rowsets
Hi,
I have a requirement where i need to search the db rows on and append the results the adf rich table on each search.
For this i am using af:query component. And trying to get the result rows for the named criteria.
String mexpr = "#{bindings.DestinDescVOCriteriaQuery.processQuery}";
processMethodExpression(mexpr, queryEvent, QueryEvent.class);
ViewCriteriaManager vcm = getDestinDescViewObj().getViewCriteriaManager();
ViewCriteria vc = vcm.getViewCriteria("DestinDescVOCriteria");
getDestinDescViewObj().applyViewCriteria(vc);
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
adfFacesContext.addPartialTarget(tblDestinDesc);
However on each click of search the rows searched in the previous attempt are not retained.
Can anyone let me know how to get the result from named criteria and append it the table?
Thanks
AjayCan anyone help?
-
When we run query how it gets the characteristic values and attributes.
Hi,
When we load transaction data it chacks characteristic values then SIDs then DIM IDs then insert DIM IDs into fact table but when we run the query how it checks and gets the characteristic values and attributes.
Bye
GKwhen we run the query how it checks and gets the characteristic values and attributes.
Just the opposite way you have described. It gets from the corresponding masterdata tables, with the connected SID. -
How to modify the query to get the output in a single row
Hi All,
Below is the query i have written it works fine
select DISTINCT right(left(CTACCT,13),4) AS LocationNum,
tODS_GLBalance.FiscalYearId AS FiscalYearId,
tODS_GLBalance.FiscalMonthOfYearId AS FiscalMonthOfYearId,
--tods_GLMetadata.Metric,
Case when
tods_GLMetadata.Metric = 'Gross Margin'
Then SUM(Balance)
Else 0
END AS GrossMargin,
Case when
tods_GLMetadata.Metric = 'Occupancy'
Then SUM(Balance)
Else 0
END AS Occupancy,
Case when
tods_GLMetadata.Metric = 'Payroll Dollars'
Then SUM(Balance)
Else 0
END AS Payroll,
Case when
tods_GLMetadata.Metric = 'CF Sales'
Then SUM(Balance)
Else 0
END AS OperatingSales,
Case when
tods_GLMetadata.Metric = 'Operations'
Then SUM(Balance)
Else 0
END AS OperatingExpenses
-- 0 as payroll
from ods.[JJill].[tODS_GLBalance]
inner join ods.Staging.tODS_INF_GLPCT ON tODS_GLBalance.PageNum = tODS_INF_GLPCT.CTPAGE
inner join ods.JJill.tods_GLMetadata ON tods_GLMetadata.AcctDescription = tODS_INF_GLPCT.CTDESC
where
(tODS_GLBalance.FiscalYearId = 2012) and
(tODS_GLBalance.FiscalMonthOfYearId = 2) and
(right(left(CTACCT,13),4)= 3020)
group by
right(left(CTACCT,13),4),
tODS_GLBalance.FiscalYearId,
tODS_GLBalance.FiscalMonthOfYearId,
tods_GLMetadata.Metric
This is the sample output,
LocationNum FiscalYearId FiscalMonthOfYearId GrossMargin Occupancy Payroll OperatingSales OperatingExpenses
3020 2012 2 -112477.00 0.00 0.00 0.00 0.00
3020 2012 2 0.00 0.00 0.00 -158288.94 0.00
3020 2012 2 0.00 0.00 0.00 0.00 5625.44
3020 2012 2 0.00 0.00 24185.79 0.00 0.00
3020 2012 2 0.00 31075.53 0.00 0.00 0.00
But, i am expecting the output to be something like this
LocationNum FiscalYearId FiscalMonthOfYearId GrossMargin Occupancy Payroll OperatingSales OperatingExpenses
3020 2012 2 -112477.00 31075.53 24185.79 -158288.94 5625.44
Can someone please help me with changing my query to get the desired output?
Please let me know if you have any questions.
ThanksTry this:
SELECT DISTINCT
RIGHT(LEFT(CTACCT,13),4) AS LocationNum, tODS_GLBalance.FiscalYearId AS FiscalYearId, tODS_GLBalance.FiscalMonthOfYearId AS FiscalMonthOfYearId,
SUM(CASE WHEN tods_GLMetadata.Metric = 'Gross Margin' THEN Balance ELSE 0 END ) AS GrossMargin,
SUM(CASE WHEN tods_GLMetadata.Metric = 'Occupancy' THEN Balance ELSE 0 END ) AS Occupancy,
SUM(CASE WHEN tods_GLMetadata.Metric = 'Payroll Dollars' THEN Balance ELSE 0 END ) AS Payroll,
SUM(CASE WHEN tods_GLMetadata.Metric = 'CF Sales' THEN Balance ELSE 0 END ) AS OperatingSales,
SUM(CASE WHEN tods_GLMetadata.Metric = 'Operations' THEN Balance ELSE 0 END ) AS OperatingExpenses
FROM ods.[JJill].[tODS_GLBalance]
INNER JOIN ods.Staging.tODS_INF_GLPCT
ON tODS_GLBalance.PageNum = tODS_INF_GLPCT.CTPAGE
INNER JOIN ods.JJill.tods_GLMetadata
ON tods_GLMetadata.AcctDescription = tODS_INF_GLPCT.CTDESC
WHERE tODS_GLBalance.FiscalYearId = 2012
AND tODS_GLBalance.FiscalMonthOfYearId = 2
AND RIGHT(LEFT(CTACCT,13),4) = 3020
GROUP BY right(left(CTACCT,13),4), tODS_GLBalance.FiscalYearId, tODS_GLBalance.FiscalMonthOfYearId, tods_GLMetadata.Metric -
Audio CDs get "The disk you inserted was not readable by this computer"
Hi All,
This a near-duplicate of a message originally posted to the Snow Leopard forums.
A couple months ago I upgraded to 10.6.4 from Leopard and configured a Boot Camp partition running Windows 7. Yesterday I discovered that whenever I put any audio CD, retail or burned, into the Macbook's drive I now get this message - "The disk you inserted was not readable by this computer" - with the options to ignore or eject. Disk Utility displays no unusual information, but a check of the system log on Console turned up this:
Sep 8 11:05:21 Hard-Drive diskarbitrationd17: unable to probe /dev/disk1 (status code 0x00000047).
Has anyone encountered this problem before? I suspect it's related to Boot Camp but not to the initial installation - CD reading worked fine right after the install. Note that this only affects CDs - Burned and retail DVDS read without any trouble.
Michael
P.S. The CDs tested include one just out of the shrink wrap, so please, no "have you checked your CDs they may be scratched" replies.Thanks, but no thanks. This is a software/hardware (driver?) issue, not a hardware issue alone. I kept a bootable backup copy of my 10.5.8 installation on an external drive, and a quick restart into that yields a desktop where CDs still load perfectly. I'm looking for power users with specific experience with this particular error and insights into what is causing it in 10.6.4.
Message was edited by: mlach, who is tired from simultaneously troubleshooting this and an X11 error and has forgotten how to type. -
Reporting or Query Rule to get the machines with particular software Update.
Hello Guys,
My Device collection has 10 machines, Need to get information whether these machines have
Service Pack 2 for Microsoft Office 2010 (KB2687455) 32-Bit Edition
installed,
Please help me with the query rule or correct reporting to get the information. Since the Updates are
not listed under Add or Remove programs am not able to use other reporting which i use normally.
Please assist.Are you sure that you don't see the SP in add/remove programs if you click "View installed updates"?
You should...
You can use hardware inventory to pick up the info, but you need to enable the Hardware Inventory Class "quick fix engineering (Win32_QuickFixEngineering)" in the client settings.
Then you can use a query, e.g.
SELECT
HotFixID0
,Description0
,InstalledOn0
FROM
v_GS_QUICK_FIX_ENGINEERING -
MDX query for to get the data from two cubes
Hi
Can you tell me how to create MDX query to get the values from two cubes. (One hierarchy from first cube and one hierarchy from second cube)
Can you give me one example.
Regards,
Madhu.
SudhanHi Sudhan,
According to your description, you want to retrieve data from two different cubes, right? The short answer is yes. To query multiple cubes from a single MDX statement use the LOOKUPCUBE function (you can't specify multiple cubes in your FROM statement).
The LOOKUPCUBE function will only work on cubes that utilize the same source database as the cube on which the MDX statement is running. For the detail information about it, please refer to the link below to see the blog.
Retrieving Data From Multiple Cubes in an MDX Query Using the Lookupcube Function
Regards,
Charlie Liao
TechNet Community Support -
Help require to get the XML output to design template- JDE
Hi Friends,
I am asking this question from JDE perspective.I want to design XMLP Template for R40572 Check Printing.
When I upload an blank template and after attaching RD, When ever I initiate a check from P04572 Application.RThe Write Row exit will lead to check printing which in turn will call a batch R04571 and this batch will call R04572(Which I require the XML output) since it is the second report and we cant direct it to local server I am not able to get the XML output..
Another think is since its running in server i think its not taking the RD modification we done in loacl because it always fires PDF .Hi,
I assume you're Using XMPOSA for generating the files locally. What I suggest is, you set the application to run with the report definition by default. That way, even when it is called, it will be called along with the report definition. You can take the resultant XML file from P95630
hope this helps,
-Domnic
Maybe you are looking for
-
Help - My 5th Generation Ipod not recognised by ITunes but 1st Gen Ipod is!
Can anyone help? This is driving me mad! I recently purchased a 5th Generation 80gb Ipod. Before installing to my PC I downloaded the latest 7.2 version of ITunes together with quicktime. However whenever I plug my new Ipod in, nothing happens other
-
Microsoft Word 2008 wonays no hard drive space available, which
I have 196 GB of free hard drive space as well as 4 GB of RAM on my MacBook Pro. No other applications are running. No volumes are mounted to the desktop. I am running the most recent Mac OS (10.5.8) and have installed all Microsoft Office 2008 updat
-
Using Calendar Year Month in query designer to populate a Month Structure
Hi Is it possible to create a query that has a standard structure of Month Columns (Jan-Dec) with each month column populated by the correct 0CALMONTH (similar infoobject) value? I would also like to be able to filter this by the correct year select
-
They Are Not Talking To Each Other
I just bought a new iMac. With the old iMac, every time that iTunes was launched, the computer would sync with Apple TV. This computer does not sync with the launching of iTunes. I found this out when I rented a movie last night and tried to watch it
-
Problems starting server from within CFBuilder
I recently installed CFBuilder and setup a localhost server. I did not check the box to Use Windows Service to start/stop in the server setting. I currently have the CF Server set to manually startup in the Windows Services. When I finished the s