Form help [message #538610] |
Sat, 07 January 2012 10:52 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/b67bac86347893e6e46078bde5fbf06f?s=64&d=mm&r=g) |
winnitbaker
Messages: 20 Registered: January 2012
|
Junior Member |
|
|
I think this is to do with more pl/sql than forms so sorry if wrong part of forums. Basically i have a form with data and 2 blank text boxes and a button. The one text box is date from and the other is date to, when the button is pressed I only want the data to be showing between the 2 entered dates. I know the code for sql but not sure for pl/sql and in forms. The names of the text boxes are dateFrom and dateTo. the sql statement -
select * from workload where date_of_meeting between
to_date('24/03/2011','DD-MM-YYYY') and to_date
('22/04/2012', 'DD-MM-YYYY');
[Updated on: Sat, 07 January 2012 10:54] Report message to a moderator
|
|
|
|
|
|
Re: Form help [message #538616 is a reply to message #538615] |
Sat, 07 January 2012 11:38 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/b67bac86347893e6e46078bde5fbf06f?s=64&d=mm&r=g) |
winnitbaker
Messages: 20 Registered: January 2012
|
Junior Member |
|
|
I have a form with data on it, but I want to restrict this data by using 2 extra text boxes created on the form. The one text box is dateto and the other text box is date from. I want only the data to be displayed in between these 2 dates. The data on the form has a column called date_of_meeting and this is what I where the text boxes will filter. I was wondering how to do this with a click of a button, I have shown what i want in the sql statement above its just in the forms i am unsure about
thanks
[Updated on: Sat, 07 January 2012 11:40] Report message to a moderator
|
|
|
|
|
Re: Form help [message #538621 is a reply to message #538619] |
Sat, 07 January 2012 12:16 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Technically speaking, if your users *know* how to use Forms built-in querying capabilities, you don't need none of DATE_FROM, DATE_TO and FILTER button. You'd enter query mode, enter :a into the DATE_OF_MEETING (if I read it well) item, push execute_query; a window will open. Enter :a between to_date('24.03.2011', 'dd.mm.yyyy') and to_date('28.11.2011', 'dd.mm.yyyy') in there and push ... ummm, "Search" I think (not 100% sure, but you'll figure it out yourself).
Apparently, DATE_FROM and DATE_TO are not database items. You can leave them in current (database) block. However, why do you care where they are? It is kind of "best practices" to put such an items into a separate, control block. If you don't want to, go ahead.
|
|
|
|
|
|
|
|
|
Re: Form help [message #538771 is a reply to message #538766] |
Mon, 09 January 2012 06:31 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/b67bac86347893e6e46078bde5fbf06f?s=64&d=mm&r=g) |
winnitbaker
Messages: 20 Registered: January 2012
|
Junior Member |
|
|
I created a control block on the same canvas as my data block, the control block has 2 text box items set as date. One date_from one date_to, the data block has fields related to the table one called date_of_meeting, the schedule of meeting is the data block. The code is behind the when button pressed trigger. Below is the code -
set_block_property('SCHEDULE_OF_WORKLOAD', onetime_where, 'date_of_meeting between :date_from and :date_to');
go_block('SCHEDULE_OF_WORKLOAD');
execute_query;
[Updated on: Mon, 09 January 2012 06:31] Report message to a moderator
|
|
|
|