473,395 Members | 1,666 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,395 software developers and data experts.

Adding parameters to a filter for a report

1
Hi Guys

I need help very agent, I just started learning PL/SQL for oracle and I have a task that I need to fix. I'm required to create a report system using report filter to pass parameters e.g Dates, listbox, textboxex etc. I have the following SQL:
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT CC.iid,
  2.                 CC.Shortcode || '.' || CC.NAME Occupation,
  3.                 G.Shortcode || '.' || G.NAME || '<br>' || F.Shortcode || '.' || F.NAME || '<br>' || E.Shortcode || '.' || E.NAME || '<br>' || D.Shortcode || '.' || D.NAME OFOAll,
  4.                 CC.iID ofoOccupationID,
  5.                 ( SELECT COUNT(V.iID)
  6.                   FROM inveloper.conOrganisationVacancies V
  7.                     WHERE V.ofoOccupationID = CC.iid ) Opportunities
  8.   FROM inveloper.ofoOccupation CC
  9.          JOIN inveloper.conOrganisationVacancies V             ON CC.iid = V.ofoOccupationID
  10.          LEFT JOIN inveloper.conOrganisation O             ON V.conOrganisationID = O.iid
  11.          LEFT JOIN inveloper.ofoUnit D             ON D.iID = CC.ofoUNitID
  12.          LEFT JOIN inveloper.ofoMinor E             ON E.iID = D.ofoMinorID
  13.          LEFT JOIN inveloper.ofoSubMajor F             ON F.iID = E.ofoSubMajorID
  14.          LEFT JOIN inveloper.ofoMajor G             ON G.iID = F.ofoMajorID
  15.          LEFT JOIN inveloper.globState H             ON V.globStateID = F.iID
  16.          LEFT JOIN inveloper.conSetaIndustry SI             ON V.ConSetaIndustryID = SI.iid
  17.          LEFT JOIN inveloper.conSETA S             ON SI.conSETAID = S.iid
  18.   WHERE (1=1)
  19.  
I need filter the report using date, Listboxes containing data from oracle database. I don't know if i'm making sence to u guys. Pls help!
Dec 11 '07 #1
3 1664
Rabbit
12,516 Expert Mod 8TB
You have posted in the wrong forum. Your thread will be moved.
Dec 11 '07 #2
amitpatel66
2,367 Expert 2GB
Hi Cryzo,

Welcome to TSDN!!

Please make sure you follow POSTING GUIDELINES every time you post in this forum.

Thanks
MODERATOR
Dec 12 '07 #3
amitpatel66
2,367 Expert 2GB
Hi Guys

I need help very agent, I just started learning PL/SQL for oracle and I have a task that I need to fix. I'm required to create a report system using report filter to pass parameters e.g Dates, listbox, textboxex etc. I have the following SQL:
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT CC.iid,
  2.                 CC.Shortcode || '.' || CC.NAME Occupation,
  3.                 G.Shortcode || '.' || G.NAME || '<br>' || F.Shortcode || '.' || F.NAME || '<br>' || E.Shortcode || '.' || E.NAME || '<br>' || D.Shortcode || '.' || D.NAME OFOAll,
  4.                 CC.iID ofoOccupationID,
  5.                 ( SELECT COUNT(V.iID)
  6.                   FROM inveloper.conOrganisationVacancies V
  7.                     WHERE V.ofoOccupationID = CC.iid ) Opportunities
  8.   FROM inveloper.ofoOccupation CC
  9.          JOIN inveloper.conOrganisationVacancies V             ON CC.iid = V.ofoOccupationID
  10.          LEFT JOIN inveloper.conOrganisation O             ON V.conOrganisationID = O.iid
  11.          LEFT JOIN inveloper.ofoUnit D             ON D.iID = CC.ofoUNitID
  12.          LEFT JOIN inveloper.ofoMinor E             ON E.iID = D.ofoMinorID
  13.          LEFT JOIN inveloper.ofoSubMajor F             ON F.iID = E.ofoSubMajorID
  14.          LEFT JOIN inveloper.ofoMajor G             ON G.iID = F.ofoMajorID
  15.          LEFT JOIN inveloper.globState H             ON V.globStateID = F.iID
  16.          LEFT JOIN inveloper.conSetaIndustry SI             ON V.ConSetaIndustryID = SI.iid
  17.          LEFT JOIN inveloper.conSETA S             ON SI.conSETAID = S.iid
  18.   WHERE (1=1)
  19.  
I need filter the report using date, Listboxes containing data from oracle database. I don't know if i'm making sence to u guys. Pls help!
In your query, add the filter conditions:

Something like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. hdate DATE;
  3. emp_no NUMBER;
  4.  
  5. hdate:= (Your date value)
  6. emp_no:= (your list box value)
  7.  
  8. SELECT * from table_name WHERE
  9. hiredate = hdate AND empno =  emp_no;
  10.  
  11.  
Use above logic for your query and I hope you an achieve what you are looking for!!
Dec 12 '07 #4

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

Similar topics

0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
3
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where...
6
by: Jonathan LaRosa | last post by:
I am trying to open a recordset and I am getting an error and I can't figure out why. See code below. sqlString2 does not work. sqlString does. Clearly the problem is with the nested SELECT...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
3
by: Matt MacDonald | last post by:
I'm trying to run a report using a form containing a crystal report viewer, but I keep getting an error saying tha "The specified value type is different to the current value type I'm trying to use...
1
by: jim4u | last post by:
Hi gurus, I have an automation add-in created using C# for Excel, in which I am exposing a number of functions. Is there any way I can add help-text the way excel does for other categories like...
0
by: gabylever | last post by:
Hello, I have the following problem. I want to export a Crystalreports report to pdf from our c# web application. It works fine. The pdf is created but the parmeters set in the code are not used...
1
by: archeykun | last post by:
Hi all, I have created the ad-hoc report via Report Builder. I would like to define some parameters to my report, so I go to Report then select filter and double click at "Year" field which i...
3
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.