SQL Query to find cumulative values for a Financial Year
Dear users,
My requirement is to create a SQL query for a table/view where I have day-wise data. I want to find out cumulative values for financial year by giving any date. It should add the values from start of financial year till that date in the financial year.
I think creating a view of such type will post heavy burden on resources since accuimulation will be done for each day upto that day.
Thanks
Dear users,
My requirement is to create a SQL query for a
table/view where I have day-wise data. I want to
find out cumulative values for financial year by
giving any date. It should add the values from start
of financial year till that date in the financial
year.
I think creating a view of such type will post heavy
burden on resources since accuimulation will be done
for each day upto that day.
ThanksKumar's solution will serve yours purpose but m not agreed
I think creating a view of such type will post heavy
burden on resources since accuimulation will be done
for each day upto that day. Khurram
Similar Messages
-
Sql query to find the balances for a customer account wise.
Hi,
Could someone help me with the sql query to find the balances for each customer account wise. This is need to generate the report.
presently we are using this query, but the output doesnot return the expected result.
SELECT sum(nvl(ps.acctd_amount_due_remaining,0)) "Balance"
FROM ra_cust_trx_line_gl_dist_all gld,
gl_code_combinations c,
ar_payment_schedules_all ps,
RA_CUSTOMER_TRX_ALL rat,
ra_customers rc
WHERE c.CHART_OF_ACCOUNTS_ID = 101
and gld.code_combination_id = c.code_combination_id
and rat.CUSTOMER_TRX_ID=gld.CUSTOMER_TRX_ID
and rat.CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
and ps.customer_id=rc.customer_id
and ps.status='OP'
and ps.gl_date <= :PDATE
and ps.org_id=:PORGID
and ps.class in ('GUAR','INV','DM','DEP')
and c.SEGMENT4=:Account_id
and ps.customer_id=:Customer_id
Thanks in advance.
Kalyan.Can someone help us with this.
-
Sql query to find all contacts for an account
I wonder if someone wrote an sql query to find all contacts for an account number in Oracle customer master. We are on EBS 11.5.10.
I am also looking for sql query to find all ship to addresses for an account number.
Thanks.Can you also post the query for people who read this post and are also looking for an answer?
Regards,
Johan Louwers. -
Write the sql query to find largest value in row wise without using great
write the sql query to find largest value in row wise without using
greatest fuction?Another not so good way, considering you want greatest of 4 fields from a single record:
SQL> ed
Wrote file afiedt.buf
1 with t as (Select 100 col1,200 col2,300 col3,400 col4 from dual
2 union select 500,600,700,800 from dual
3 union select 900,1000,1100,1200 from dual
4 union select 1300,1400,1500,1600 from dual
5 union select 1700,1800,1900,2000 from dual
6 union select 2100,2200,2300,2400 from dual
7 union select 2800,2700,2600,2500 from dual
8 union select 2900,3000,3100,3200 from dual)
9 SELECT (CASE WHEN col1 > col2 THEN col1 ELSE col2 END) Max_value
10 FROM
11 (SELECT (CASE WHEN col1_col2 > col2_col3 THEN col1_col2 ELSE col2_col3 END) col1,
12 (CASE WHEN col2_col3 > col3_col4 THEN col2_col3 ELSE col3_col4 END) col2,
13 (CASE WHEN col3_col4 > col4_col1 THEN col3_col4 ELSE col4_col1 END) col3
14 FROM
15 (SELECT (CASE WHEN col1 > col2 THEN col1 ELSE col2 END) col1_col2,
16 (CASE WHEN col2 > col3 THEN col2 ELSE col3 END) col2_col3,
17 (CASE WHEN col3 > col4 THEN col3 ELSE col4 END) col3_col4,
18 (CASE WHEN col4 > col1 THEN col4 ELSE col1 END) col4_col1
19* FROM t))
SQL> /
MAX_VALUE
400
800
1200
1600
2000
2400
2800
3200
8 rows selected.
SQL> Edited by: AP on Sep 21, 2010 6:29 AM -
Sql query - Selecting last recorded values for each date in specified period
Hello,
Can someone please help me with my problem.
I'm trying to get last recorded balance for each day for specific box (1 or 2) in specified period of days from ms access database using ADOTool.
I'm trying to get that information with SQL query but so far unsuccessfully...
My table looks like this:
Table name: TestTable
Date Time Location Box Balance
20.10.2014. 06:00:00 1 1 345
20.10.2014. 12:00:00 1 1 7356
20.10.2014. 18:45:00 1 1 5678
20.10.2014. 23:54:00 1 1 9845
20.10.2014. 06:00:02 1 2 35
20.10.2014. 12:00:04 1 2 756
20.10.2014. 18:45:06 1 2 578
20.10.2014. 23:54:10 1 2 845
21.10.2014. 06:00:00 1 1 34
21.10.2014. 12:05:03 1 1 5789
21.10.2014. 15:00:34 1 1 1237
21.10.2014. 06:00:00 1 2 374
21.10.2014. 12:05:03 1 2 54789
21.10.2014. 15:00:34 1 2 13237
22.10.2014. 06:00:00 1 1 8562
22.10.2014. 10:00:00 1 1 1234
22.10.2014. 17:03:45 1 1 3415
22.10.2014. 22:00:00 1 1 6742
22.10.2014. 06:00:05 1 2 562
22.10.2014. 10:00:16 1 2 123
22.10.2014. 17:03:50 1 2 415
22.10.2014. 22:00:10 1 2 642
23.10.2014. 06:00:00 1 1 9876
23.10.2014. 09:13:00 1 1 223
23.10.2014. 13:50:17 1 1 7768
23.10.2014. 19:47:40 1 1 3456
23.10.2014. 21:30:00 1 1 789
23.10.2014. 23:57:12 1 1 25
23.10.2014. 06:00:07 1 2 976
23.10.2014. 09:13:45 1 2 223
23.10.2014. 13:50:40 1 2 78
23.10.2014. 19:47:55 1 2 346
23.10.2014. 21:30:03 1 2 89
23.10.2014. 23:57:18 1 2 25
24.10.2014. 06:00:55 1 1 346
24.10.2014. 12:30:22 1 1 8329
24.10.2014. 23:50:19 1 1 2225
24.10.2014. 06:01:00 1 2 3546
24.10.2014. 12:30:26 1 2 89
24.10.2014. 23:51:10 1 2 25
Let's say the period is 21.10.2014. - 23.10.2014. and I want to get last recorded balance for box 1. for each day. The result should look like this:
Date Time Location Box Balance
21.10.2014. 15:00:34 1 1 1237
22.10.2014. 22:00:00 1 1 6742
23.10.2014. 23:57:12 1 1 25
So far I've managed to write a query that gives me balance for ONLY ONE date (date with highest time in whole table), but I need balance for EVERY date in specific period.
My incorrect code (didn't manage to implement "BETWEEN" for dates...):
SELECT TestTable.[Date], TestTable.[Time], TestTable.[Location], TestTable.[Box], TestTable.[Balance]
FROM TestTable
WHERE Time=(SELECT MAX(Time)
FROM TestTable
WHERE Location=1 AND Box=1 );
Tnx!
Solved!
Go to Solution.For loop
following query keep day (here 24 in below query) Variable from ( 1 to 28-29/30/31 as per month)
SELECT TOP 1 TestTable.[Date], TestTable.[Time], TestTable.[Location], TestTable.[Box], TestTable.[Balance]
FROM Test Table.
WHERE Time=(SELECT MAX(Time) FROM TestTable WHERE Location=1 AND Box=1 )
AND DATE = "2014-10-24";
PBP (CLAD)
Labview 6.1 - 2014
KUDOS ARE WELCOMED.
If your problem get solved then mark as solution. -
Sql query to find answered and received calls for month or day
Hi experts !
1.Any one help in finding out the received, answered and missed ,transfered in / out calls in UCCE using SQL query for a particular month or day.
2. We have some custom report templetes defined , need to know , how can we write Sql query to get those values from custum reports.
due to some issues, cannot use webview .Hi,
there's no such thing as reporting "for a particular Team". Teams in ICM are for administration purposes only (to have grouping of agents). ICM does not count the number of calls received by "teams". If there is a report in Webview "by team", it's always by agent. Try to run the report against a team once and then try to remove certain agents from that team - you'll see the difference.
What you are looking for is either reporting by Agent or by Agent/Skill group combination.
Try to explore the
- Agent_Half_Hour
- Agent_Skill_Group_Half_Hour
- Skill_Group_Half_Hour
database views.
The database schema documents are here:
http://www.cisco.com/en/US/products/sw/custcosw/ps1844/prod_technical_reference_list.html
Good luck.
G. -
SQL query to find sqlnet.ora parameters
Hi All,
I am working 11g RAC /solaris 9
I want have sql query to find values of sqlnet.ora parameters
May be values of SQLNET.INBOUND_CONNECT_TIMEOUT
SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT
Thanks
rajThe sqlnet.ora file is the profile configuration file. It resides on the client machines and the database server.
Profiles are stored and implemented using this file. The database server can be configured with access control parameters in the sqlnet.ora file.
These parameters specify whether clients are allowed or denied access based on the protocol.
The sqlnet.ora file enables you to do the following:
Specify the client domain to append to unqualified names
Prioritize naming methods
Enable logging and tracing features
Route connections through specific processes
Configure parameters for external naming
Configure Oracle Advanced Security
Use protocol-specific parameters to restrict access to the database
By default, the sqlnet.ora file is located in the ORACLE_HOME/network/admin directory. The sqlnet.ora file can also be stored in the directory specified by the TNS_ADMIN environment variable.
You can not query on this file sqlnet.ora as tnsnames.ora file.
Regards
Mahir M. Quluzade -
[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specifi
[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
An you help me with this error?
This is the problemativ query:
Search QUERY : SELECT DISTINCT theK_files.fileid, theK_files.name, theK_files.t
itle, theK_files.description, theK_users1.name AS AuthorName, theK_users1.surn
ame AS AuthorSurname, [theK_file-extensions].name AS Extension, theK_files.publ
ished, theK_files.updated FROM theK_users INNER JOIN [theK_users-to-groups] ON
theK_users.userid = [theK_users-to-groups].userid INNER JOIN theK_usergroups
ON [theK_users-to-groups].groupid = theK_usergroups.groupid INNER JOIN [theK_g
roups-to-files] ON theK_usergroups.groupid = [theK_groups-to-files].groupid INN
ER JOIN theK_files ON [theK_groups-to-files].fileid = theK_files.fileid INNER
JOIN theK_users theK_users1 ON theK_files.authorid = theK_users1.userid INNER
JOIN [theK_file-extensions] ON theK_files.extensionid = [theK_file-extensions]
.extensionid WHERE theK_users.userid = '1' AND theK_files.extensionid = '1' AN
D ( theK_files.name LIKE '%a%' OR theK_users1.name LIKE '%a%' OR theK_files.de
scription LIKE '%a%' )are these columns character/string/varchar:
theK_users.userid = '1'
theK_files.extensionid = '1'
if these are number columns, change them to
theK_users.userid = 1
theK_files.extensionid = 1
Jamie -
Can anybody provide the SQL query to find the files uploaded in a particular folder?
Hi All,
Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
Any help is greatly appreciated.
With best regards,
NevinNevin,
Be great if we could know the version of Portal. For Rel. 1, here's the query
select id,masterthingid from wwv_things
where siteid = &site
and cornerid = &corner
&site - Content Area id
&corner - Folder id
if you don't know the folder id, use
select id from wwv_corners where siteid = &site
and name = &folder
Hope this helps. I have run into this situation before. Usually, the culprits were
one of the following:
1. Junk Characters in description of item (caused due to Copy-Paste)
2. Special Characters in the File name
Hi All,
Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
Any help is greatly appreciated.
With best regards,
Nevin -
SQL Query to find menus and submenus attached to responsibility
Hi,
I am looking for help to find out a sql query to pull out the list of all the menu's associated with each of the responsibilities assigned to users. Please let me know any SQL query to find out menus attached for responsibilities assigned to users.835129 wrote:
I was asked by my lead to list out responsibilities and attached menus and I was asked to submit the output from production. In the metalink note provided by you it was asked to create table collecting all menu id's and I cannot create any tables in production. Apart from this there were 1000's of users with different responsibilities and different menus. I cannot collect all of the users menu ids.
I just want to list out responsibilities and attached menus. Is that something you can helpout withhttps://forums.oracle.com/forums/search.jspa?threadID=&q=fnd_responsibility_vl+AND+fnd_menu&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
https://forums.oracle.com/forums/search.jspa?threadID=&q=fnd_responsibility_tl+AND+FND_MENU_ENTRIES_TL&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
Please search the forum for these tables/views and you should get many hits:
FND_MENU_ENTRIES_TL
FND_MENU_ENTRIES_VL
FND_RESPONSIBILITY_TL
FND_RESPONSIBILITY_VL
Thanks,
Hussein -
SQl query to find incompatibility defined
If two programs are defined as incompatible with one another, the data these programs cannot access simultaneously must also be identified.
This can be found from concurrent program->define from front end ebs login, but is there any SQL query to find this for a particular program or request set??
Thanks in advance.Please search the forum before posting similar questions.
Concurrent-Conflict
Re: Concurrent-Conflict
Thanks,
Hussein -
SQL Query to Find out User has what all resources provisioned !
Hi Guys ,
Does any one have a SQL query to find out what resources are provisioned to a particular user ?
Thanks
SurenHi,
Hope this will help you.
SELECT distinct usr_login as "IdM User ID",
usr_employeeID as "Employee ID",
usr.USR_FIRST_NAME as "First Name",
usr.USR_LAST_NAME as "Last Name",
usr_status
as "User Status",
USR_EMP_TYPE as "Employee Type",
obj.obj_name as "Application Resource",
ost_status as "Application Resource Status",
FROM ost,oiu,obj,usr,obi
WHERE oiu.ost_key = ost.ost_key AND obj.obj_key = obi.obj_key AND oiu.usr_key = usr.usr_key
AND ost_status in ('Provisioned','Revoked','Disabled', 'Provisioning')
AND oiu.obi_key=obi.obi_key
AND usr_EmployeeID like '11111'
This query will provide all the resources to which the user is linked with and the resource status is in 'Provisioned','Revoked','Disabled', 'Provisioning' status for a particular employeed ID, I am not completely sure whether I have given the Employee ID column from USR table as correct or not. Verify once and query the DB -
SQL query to find access database files?
Odd request, but does anyone have a SQL query to find files? Specifically, I am looking for machines that have access databases on them. .mdb & .accdb
Have you enabled inventory for them?
Garth Jones | My blogs: Enhansoft and
Old Blog site | Twitter:
@GarthMJ
i was trying to figure out where that option was but couldn't find it under hierarchy settings. perhaps it's been changed since 2012 R2? can you help point it out? -
Correlated query to find cheapest manufacturer for a product
Hi,
I have a SQL Query that returns me:
- the "product code" i must purchase,
- the "quantity" to purchase for this product
- and if it's in "promotion or not".
Based on this result, i must to look at "manufacturer" table and find the cheapest "price" for each product to purchase and the quantity available at the manufacturer.
If "quantity to order" (e.g. 20) is higher than "quantity available" (e.g. 12) at "cheapest manufacturer", i must order the missing quantity (8) to the next cheapest manufacturer.
How can i do that ?
thxHi
>>correlated query to find cheapest manufacturer for a product
I have created two table [ProdTable] , [Product Code] to get the cheapeast manufacturer for a product which you can refer to .
[Product Table]
[Prod Table]
select [ProdTable].[S_Prod_Code],Min([ProdTable].[Prod_Cost]) as MiniCost
from [ProdTable] inner join [Product Table] on [ProdTable].[S_Prod_Code]=[Product Table].[Product Code]
Where [Product Table].[Promotion]<>"YES"
group by [ProdTable].[S_Prod_Code]
Using the above query ,you can get the cheapest cheapeast manufacturer for a product , which the promotion is not YES
>>for promotional products, i must firstly check if the cheapest manufacturer has enough prod in stock. If not, i order all the prod in stock the manufacturer has, and i must order to missing ones to the next cheapest manufacturer
Are you looking for a select query or an update to the table or form design ?Can you separate your business rules with the technolege ? So more people could understand your issues well to give you more help.
Thanks for your understanding
Best Regards
Lan
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Creation of a Query to show the values for the current month and the last 12 months data.
Dear All,
Good day!
I have to create a Query with the below requirement.
I have to create a Query to show the values for the current month and the last 12 months data.
Can you please guide me how to achieve this ??
thank you,
Regards,
HemaHema
explain the exact problem..? as you mentioned you want to create query to show values for current month and last 12 months.. so I think you want to show values for 12 months from current data.. you can achive this by multiple way..
you can have selection screen and field with date .. and restrict based on system current date and 12 months before or you can handle this at your target.. .. I mean there are multiple ways to restrict data by date range..
for some more hints..
http://www.forumtopics.com/busobj/viewtopic.php?t=34393&sid=7fba465d0463bf7ff5ec46c128754ed6
http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/how-to-display-last-12-months-in-report-based-on-todays-date-3231850
http://scn.sap.com/thread/3217381
search on SDN you will get many other ways..
Thanks,
Bhupesh
Maybe you are looking for
-
Is there a way to import large photos without it resizing them?
I have a series of historical USGS maps that are in JPG format. I synced them to the iphone using Itunes and I came to discover the phone resized them down so I can't zoom in to the level of detail I need. Is there a way to sync them as their origina
-
NVidia-185.18.14, Quadro NVS & Multi-monitor
For anyone who recently upgraded their drivers to 185.18.14, you may have this problem where your secondary monitor refuses to work anymore. This is especially so if : - your graphics card is one of those Quadro types - it has one of those special
-
Printing with xsql and css or xsl and fop
How to incorporate css or css2 with xsql? I want some sample files. What is FOP? How can we use it for printing and print view
-
N8 Camera / Video Recording Problem
I have my N8 for good few months and enjoyed using it 'til recently. 'Unusual Problem Occurred' comes up on the screen every time I want to switch my camera from taking pictures to video mode, and you asked to turn the phone off and on again. Even if
-
Eligibility Amount for HRA/CLA/COA is zero for employee 2
Hi expert, HRA is not calculating properly, in IT581 eligibility value is calculated as zero. If suppose if I am changing this Rent amount to 10000, I am gettiing this error message Eligibility Amount for HRA/CLA/COA is zero for employee 2324 on 01.