Enter Dates according to Financial Year [message #331766] |
Sat, 05 July 2008 07:03 |
Shaheer
Messages: 50 Registered: June 2008 Location: Pakistan
|
Member |
|
|
Assalam-o-alikom: Sir,
Please see attach file I encircle the fields where i am facing problem. My problem is i want to restrict user to enter dates according to Financial Year. My form contain both two fields (FINANCIAL YEAR and BUDGET FOR THE PERIOD i.e. date). In financial year field i enter the financial e.g (2008-09), In Budget for the period field user must enter date according to entered financial year. Please help through some code.
-
Attachment: help.GIF
(Size: 62.74KB, Downloaded 497 times)
|
|
|
Re: Enter Dates according to Financial Year [message #331776 is a reply to message #331766] |
Sat, 05 July 2008 08:33 |
dude4084
Messages: 222 Registered: March 2005 Location: Mux
|
Senior Member |
|
|
Walaikum Salam
What i understand is that the from and to date of budget field must be in the range of financial year. And financual year starts from July 1 tto June 30.
I can give you idea and you have to work it yourself.
Step-1:
First of all, split the financial year. In your example you have written 2008-09. So split it in parts 2008 and 09
Store them in vairables. For example
part1:=2008;
part2:=09;
Step-2:
Make two "bonds" using concatenation and store them in date type
variables
staringdate:= to_date('01-07-'||part1, 'dd-mm-yyyy');
endingdate := to_date('30-06-20'||part2, 'dd-mm-yyyy');
Step-3:
Use when validate trigger on from/ to date and write above codes and check the folllowing validity to control the entering of the dates
If :fromdate < startingdate or :fromdate > endingdate then
Message.....;
end if;
Hope you will be able to do it
Good luck
-Dude
|
|
|
|
|
|
|
Re: Enter Dates according to Financial Year [message #331854 is a reply to message #331766] |
Sun, 06 July 2008 01:39 |
dude4084
Messages: 222 Registered: March 2005 Location: Mux
|
Senior Member |
|
|
By the way things can goose worst if the user enters anyone of the following
2008--9
200809
2008-10
etc
SO its better to make a dropdown list for the financial year input field.
This will lead to flawless mobvement of the project.
-Dude
|
|
|
Re: Enter Dates according to Financial Year [message #331856 is a reply to message #331852] |
Sun, 06 July 2008 01:42 |
dude4084
Messages: 222 Registered: March 2005 Location: Mux
|
Senior Member |
|
|
Frank wrote on Sun, 06 July 2008 11:39 | No. It's a date, then treat it as such.
Make the datatype DATE and the format-mask YYYY-MM.
Then you can use Oracle's native date-arithmetic functions.
|
Dear Frank, its Year. 2008-09 means Year 2008-2009 and indepth it means July 1 2008 to June 30, 2009.
|
|
|
|
|