Query using combobox
Hai'
I'm working on vb dotnet with sql as backend.
I'm using two forms .
1.to get the employee name and daily dates.
2.form with 2combobox----to display the month(eg.january,april)
To display the name
using table named dept with following fields:
empid varchar(50)
date datetime(8) format:dd/mm/yyyy
empfname varchar(50)
eg:
01/01/2005
04/03/2005
10/01/2005
23/03/2005
19/01/2005
jus want sql query which should compare the date format(dd/[i]mm/yyyy) with the month selected from combobox.
should i assign the string month(april,may) to numeric[b] mm as in the format and then store it in a column.
i'm doing this so that i will be able to retrive the result as a monthly report
eg:
january(selected from combobox)
01/01/2005
10/01/2005
19/01/2005
-- If combo returns numeric month
SELECT *
FROM dept
WHERE MONTH(date) = combo_month
-- If combo returns character month
SELECT *
FROM dept
WHERE MONTH(date) = CASE combo_month WHEN 'January' THEN 1 WHEN 'February' THEN 2 ...... END
Can't remember whether CASE can be used in WHERE clause. If CASE cannot be use in WHERE clause then you just need to write a simple function that can return the month in number when it accepts a character month. Unable to test out the query as I do not have SQL SERVER environment in my current job.
Similar Messages
-
ABAP query using logical database KDF is not populating custom fields
Hi Experts ,
I created two following queries
1. VENDORCATKDF – uses KDF logical database
2. VENDORCATLFA1 – uses table = LFA1
I’m pulling the same information in both queries:
· Vendor Number
· Country
· Vendor Name
· Vendor Category (custom fields added to LFA1)
The results for the query that uses the logical database KDF is incorrect. It doesn’t pull in the flag on the custom field LFA1-ZMRO. Even though the logical database KDF is made up of the table LFA1 and has these fields.
Is there something that can be done – so that all of these “custom” category fields under LFA1 (such as LFA1-ZZMRO) – get pulled into queries – when we use the logical database KDF ?Hi,
I have got the error removed by ensuring that fields from one table are a part of one line ( taking help of ruler) only. But the underlying problem remains, the output is not ALV but List output.
I do not think having additional fields in the query is reason for this.
Is it bcoz iI am adjusting the output length of columns to ensure no hierarchical error ?
Can we not have a query using LDB which is shown as SAP List?
Regards,
Garima. -
Getting an error when i am execution a BI query using ABAP.
Hi Expert,
I am getting an error when i am execution a BI query using ABAP. Its Giving me this Error "The Info Provider properties for GHRGPDM12 are not the same as the system default" and in the error analysis it saying as bellow.
Property Data Integrity has been set differently to the system default.
Current setting: 0 for GHRGPDM12
System default: u2019 7 u2018
As I am very new to BI and have very limited knowledge, so I am not able to understand this problem. Can any one help me to resolving this issue. Previously it as working fine, I am getting this error last 2 days.
when i am debugging , I am getting error from
create instance of cl_rsr_request
CREATE OBJECT r_request
EXPORTING
i_genuniid = p_genuniid.
this FM. Its not able to create the object. Can any one please help me out.
Thanks in advance.
Regards
SatrajitHi,
I am able to solve this problem
Regards
Satrajit -
Error while accessing Query using Query Analyzer
dear experts...
while accesiing the query using query analayzer...
we are getting below error...
What has happened?
URL http://xxx.xxx.xxx.xx:XXXX/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex call was terminated because the corresponding service is not available.
Note
The termination occurred in system BI1 with error code 404 and for the reason Not found.
The selected virtual host was 0 .
What can I do?
Please select a valid URL.
If you do not yet have a user ID, contact your system administrator.
ErrorCode:ICF-NF-http-c:001-u:ANAND-l:E-i:PSRCCPRDA003_BI1_00-v:0-s:404-r:Notfound
HTTP 404 - Not found
Your SAP Internet Communication Framework Team
thanks for helping me...
anandHi friends,,
instead of getting the link like
http://128.222.125.57:9000/sap/bw/bex?cmd=ldoc&infocube=ZMC_SRH1&query=AGINGV21A&sap-language=EN(working link)
am getting below link...which is getting an error....
http://128.222.125.57:9000/sap/bw/://:/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=AGINGV21A
above marked is the unwanted thing so how can i change my link in query designer???
please suggest me firneds -
Unable to create new query using query manager
Hi friends,
I have been trying to create a query using query manager for couple of hours but still not able to.I am following the instructions given in oracle Peopletools 8.52 : Peoplesoft query
Chapter - creating new queries.
Below are the steps I am going through to create new query:
Step - I open the component Reporting Tools-> Query->Query Manager , I don't get the tabbed pages one for search an existing query and another for create new query.
Please follow this link to see how the page is displayed in first step:
http://uploadpic.org/v.php?img=EvMvVAXX1E
Step 2 - When I click on create new query link, I am redirected to a page where it asks for record name to add in the query. But, even this page is not displayed as how it supposed to be
http://uploadpic.org/v.php?img=GzHh3f6krU
Step 3 - Following the above step, when I click on Person record to add into my query I am asked to select the fields that I want to display in the output.
But I somehow do not get the proper tabbed pages where individual pages are there to add the attributes to complete the query like adding multiple records, fields, query, expressions, prompt...etc
http://uploadpic.org/v.php?img=Wbbla3Q3jE
I am neither able to select multiple records in my query nor able to customize my query to get the desired results.
Below is the query that I want to create using query manager:
SELECT P.EMPLID,P.BIRTHDATE, N.NAME, A.ADDRESS1, A.ADDRESS2, A.CITY
FROM PS_PERSON P, PS_NAMES N, PS_ADDRESSES A
WHERE P.EMPLID = N.EMPLID AND
N.EMPLID = A.EMPLID AND
P.BIRTHDATE BETWEEN to_date('1990/1/1','yyyy/mm/dd') and to_date('1991/1/1','yyyy/mm/dd');Hi,
As I cannot access your screenshot by the blocking of company firewall rules.
I'm guessing currently you are using PT 8.52.00 version, correct?
This should be a bug, that you need to apply the 8.52.0X patch, not sure which patch fix this, you can apply the latest one to solve this issue for no tab page of query manager. (PT 8.52.06)
Hope this helps.
Thanks,
Saxon SI -
In DBI , how to find out the Source Query used for the Report
Hi All,
How to find out the Source Query used to display the data in the DBI Reports or Dashboards. We can get it in Apps Front end by Going to Help and Record Histroty. But DBI Runs in Internet Explorer so i dont know how to get the source query ( SELECT Query ) Used.
In IE we have View --> Source . But that does not help since it gives the HTML Coding and not the SELECT Query used.
If anyone has ever worked on it...Please help me in finding it.
Thanks,
Neeraj ShrivastavaHi neeraj,
You can see the query used to display reports.Follow these steps to get the query.
1)Login to oracle apps
2)Select "Daily Business Intelligence Administrator" responsiblity.
3)Now click on "Enable/Disable Debugging" (Now u enabled debugging)
4)now open the report which you want to see the query of
5)In view source it displays query along with the bind varilables.
Feel free to ping me if you have any doubts
thanks
kittu -
How do i know if my query using SORT_AREA_SIZE or temporary tablespace ?
Good Morning Everyone !
My DB version is 10.2.0.1
I have large table exactly 3 million records.
SQL> select count(*) from tab1;
COUNT(*)
300000
SQL> select * from tab1 order by no DESC;
sorting ... in process
300000 rows selected.
in Terminal 2 : I tried to find sorting details - ( No rows selected - why ? )
SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage ;
no rows selected
SQL> /
no rows selected
When i google i have seen this ;
If Oracle cannot do the sort in memory (SORT_AREA_SIZE initialisation parameter), space will be allocated in a temporary tablespace for doing the sort operation.
REF_LINK : TEMPORARY Tablespaces and TEMPFILES | Oracle FAQ
MY DOUBT QUESTION : How do i know if my query using SORT_AREA_SIZE or temporary tablespace ?
Thanks in advance.@ JohnWatson
I have seen some articles from ORA - FAQ. Good.
SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage;
USERNAME USER TABLESPACE SQL_ID
SCOTT SYS TEMP fh9vqgyd6m0d1
PGA management means that sorting only 300000 rows may well occur in memory
Is this (3 million rows) - standard value for 10g version ?
Thanks JohnWatson -
How can I perform this kind of range join query using DPL?
How can I perform this kind of range join query using DPL?
SELECT * from t where 1<=t.a<=2 and 3<=t.b<=5
In this pdf : http://www.oracle.com/technology/products/berkeley-db/pdf/performing%20queries%20in%20oracle%20berkeley%20db%20java%20edition.pdf,
It shows how to perform "Two equality-conditions query on a single primary database" just like SELECT * FROM tab WHERE col1 = A AND col2 = B using entity join class, but it does not give a solution about the range join query.I'm sorry, I think I've misled you. I suggested that you perform two queries and then take the intersection of the results. You could do this, but the solution to your query is much simpler. I'll correct my previous message.
Your query is very simple to implement. You should perform the first part of query to get a cursor on the index for 'a' for the "1<=t.a<=2" part. Then simply iterate over that cursor, and process the entities where the "3<=t.b<=5" expression is true. You don't need a second index (on 'b') or another cursor.
This is called "filtering" because you're iterating through entities that you obtain from one index, and selecting some entities for processing and discarding others. The white paper you mentioned has an example of filtering in combination with the use of an index.
An alternative is to reverse the procedure above: use the index for 'b' to get a cursor for the "3<=t.b<=5" part of the query, then iterate and filter the results based on the "1<=t.a<=2" expression.
If you're concerned about efficiency, you can choose the index (i.e., choose which of these two alternatives to implement) based on which part of the query you believe will return the smallest number of results. The less entities read, the faster the query.
Contrary to what I said earlier, taking the intersection of two queries that are ANDed doesn't make sense -- filtering is the better solution. However, taking the union of two queries does make sense, when the queries are ORed. Sorry for the confusion.
--mark -
SAP / ABAP Query - using logical database
Hi ,
We have a mandate to implement SAP Query using only Logical Databases (LDB ) .
We understand that there are several issues using this approach .
1 ) Paralled tables in MM need to be displayed on separate lines .
2 ) Statistics based on fields from 2 different tables cannot be produced eg: EKPO ( PO Number ) and EKKN . (Cost Center )
Please share your experiences .
Thank you in advance .
Kishore
KishoreAdeel,
I do appreciate your experience and respect you for knowledge on SAP Query.
Joining tables seem simple to IT experts but not so for end users. SAP Query is an end-user tool and users seem to need a simple user-friend, drag-and-drop solution to extract information using SAP Query based on a pre-defined infoset. Various SAP conferences have been advocating the use of SAP delivered Logical Databses to create infosets in order to harness the various advantages of LDBs.
In MM there are several LDBs (e.g. ELM, EBM etc) to create queries on EKPO and EKKN. The problem arises when you use the same LDB to extract information from more than the above two tables e.g. EKPO, EKET, EKKN and EKBE. SAP expects you to display fields on multiple lines and also does not allow producing statistics based on fields from two parallel tables say EKKN and EKBE. Moreover, multi-line reports cannot be produced in the ALV/SLV format.
We are also looking for best practise solutions in providing SAP Query to MM or FI users based on SAP delivered Logical Databases.
Pascal -
Please help to re-write this query using exists or with
Hi please help to re-write this query using exists or with, i need to write same code for 45 day , 90 days and so on but sub query condition is same for all
SELECT SUM (DECODE (t_one_mon_c_paid_us, 0, 0, 1)) t_two_y_m_mul_ca_
FROM (SELECT SUM (one_mon_c_paid_us) t_one_mon_c_paid_us
FROM (
SELECT a.individual_id individual_id,
CASE
WHEN NVL
(b.ship_dt,
TO_DATE ('05-MAY-1955')
) >= SYSDATE - 45
AND a.country_cd = 'US'
AND b.individual_id in (
SELECT UNIQUE c.individual_id
FROM order c
WHERE c.prod_cd = 'A'
AND NVL (c.last_payment_dt,
TO_DATE ('05-MAY-1955')
) >= SYSDATE - 745)
THEN 1
ELSE 0
END AS one_mon_c_paid_us
FROM items b, addr a, product d
WHERE b.prod_id = d.prod_id
AND d.affinity_1_cd = 'ADH'
AND b.individual_id = a.individual_id)
GROUP BY individual_id)
Edited by: user4522368 on Aug 23, 2010 9:11 AMPlease try and place \ before and after you code \Could you not remove the inline column select with the following?
SELECT a.individual_id individual_id
,CASE
when b.Ship_dt is null then
3
WHEN b.ship_dt >= SYSDATE - 90
3
WHEN b.ship_dt >= SYSDATE - 45
2
WHEN b.ship_dt >= SYSDATE - 30
1
END AS one_mon_c_paid_us
FROM items b
,addr a
,product d
,order o
WHERE b.prod_id = d.prod_id
AND d.affinity_1_cd = 'ADH'
AND b.individual_id = a.individual_id
AND b.Individual_ID = o.Individual_ID
and o.Prod_CD = 'A'
and NVL (o.last_payment_dt,TO_DATE ('05-MAY-1955') ) >= SYSDATE - 745
and a.Country_CD = 'US' -
Execute a query using ABAP (XSLT transformation issue)
Hello,
I made the steps from this blog (part I, II and III).
/people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
When trying to run the XSLT transformation, I got the message that : XML invalid source file.
I am not sure what are the steps for running a transformation, or running it for this case ,maybe something it's not ok. I just run it, did not provide any information.
Any suggestions ? Did anyone use the function module described in this blog ?
Thank you very much in advance.try giving
CALL TRANSFORMATION (`ID`)
SOURCE meta = meta_data[]
output = <ltable>[]
RESULT XML xml_out
OPTIONS xml_header = 'NO'.
and check - sometimes the codepages configured in the BW system tend to cause an issue... I am not sure if the syntax is right though - but you are basically trying to bypass any encoding that is happening in the query transformation....
http://www.sapetabap.com/ovidentia/index.php?tg=fileman&sAction=getFile&inl=1&id=4&gr=Y&path=ABAP%2FABAPENANGLAIS&file=ABAP-XML+Mapping.pdf&idf=41
Edited by: Arun Varadarajan on May 18, 2009 11:28 PM -
How to use user defined function in select query using Toplink
Hi Friends
I am little bit of new in Toplink stuff... so please help me...
I have to database functions 1. encrypt and 2. decrypt.
I want to exceute the following sql query using toplink
select port, database, user_name, decrypt(encrypt('String which is to be encrypt ','password'),'password') from CONFIGURATION
can anyone tell me , how to write code in toplink which will give the about sql output.
thanks .....The "Specifying a Custom SQL String in a DatabaseQuery" section in the TopLink Developer's Guide may help... http://download-uk.oracle.com/docs/cd/B32110_01/web.1013/b28218/qrybas.htm#BCFHDHBG
-
User constructed query using dropdowns
Hi all,
I am trying to create a sql query using select lists with an application page. My problem is that written as a statement it would say;
select count (distinct id)
from requests
where date_raised between '01 JUN 07' and '30 JUN 07';
but if try to have a select list passing 'date_raised' or 'date_closed' it still works but if I put another for 'between' and 'not between' it has a problem, for example;
select count (distinct id)
from requests
where :P5_SL_RAISED_CLOSED :P5_SL_BETWEEN :P5_START_DATE and :P5_END_DATE
and date_closed is null or date_closed >:P5_END_DATE;
Could someone help me please, I searched the forums and nobody seems to have done this. (Or maybe it's so simple they just didn't post!)
Thanks,
JayHi Jay,
you can accomplish this in following way:
change your report type to SQL Query(PL/SQL function body returning SQL Query),
then in region source try this:
begin
return 'select count (distinct id)
from requests where ' || :P5_SL_RAISED_CLOSED ||' '|| :P5_SL_BETWEEN || ' to_date('''|| :P5_START_DATE ||''',''DD-MM-YYYY'') AND to_date(''' || :P5_END_DATE || ''',''DD-MM-YYYY'') and date_closed is null or date_closed > to_date('''|| :P5_END_DATE || ''',''DD-MM-YYY'')';
end;
Of course, you should change DD-MM-YYYY to date format used in your fields.
Hope this helps.
Tomasz K> -
How to use Combobox to direct link
Hi all, how can i use combobox to direct link in adf. For example: I have a list of value with combobox, when i selected "Page A" ---> go to Page A, selected "Page B" ----> go to Page B
ThanksHi,
How about using a menu model instead of a combo box? Check out this example : Oracle JDeveloper 11g Release 2 Tutorials - Creating ADF Menus for Page Navigation
-Arun -
Modify query used in Materialized View
Are there any ways to modify the query used in materialized view without dropping the materialized view. I dont think alter materialized view has such an option.
Please provider me your suggestions.you have to give "ENABLE QUERY REWRITE" option then u can change your query
Maybe you are looking for
-
How to get the permission of a file in java
Hi All, I need to get the permission's that are granted to a file and how to modify its permission.Which class in java is used for this purpose?Kindly give me a solution.Thanks in advance.
-
In order to paste text from a Word document into a DreamWeaver CS3 html page, I must first paste the text into the Macintosh program TextEdit. Then I select all, copy, click into the html page and paste. Works fine. I checked my DW preferences, chang
-
(error = -49)
I tried to purchase one of the free ibooks that are from itunes. I tried both Pride and prejudice as well as the complete works of Poe. Each time I tried, I got this message "An unknown error occured (-49)" What does this even mean? 0_0 I've downloa
-
I'm about to do a clean install of my system (Dell Precision T5400 64-bit system with 2 300GB drives setup in a RAID 1 mirror and 8GB of memory). I will be running XP Pro x64 Edition with Service Pack 2. I have had itunes running over the last year f
-
[SOLVED] Qemu with host networking space.
Hello, I'm trying to lunch Qemu with host networking, so the VM's can talk to each other, what I did so far is creating the following bridges ( Actually virt-manager did that for me ): br0, virbr0 -> virbr0-nic ( the interface ) and have the followin