Home » Developer & Programmer » Forms » Enter Dates according to Financial Year
Enter Dates according to Financial Year [message #331766] Sat, 05 July 2008 07:03 Go to next message
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 Go to previous messageGo to next message
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


icon3.gif  Re: Enter Dates according to Financial Year [message #331802 is a reply to message #331776] Sat, 05 July 2008 11:26 Go to previous messageGo to next message
Shaheer
Messages: 50
Registered: June 2008
Location: Pakistan
Member
Thank you Sir
Re: Enter Dates according to Financial Year [message #331805 is a reply to message #331802] Sat, 05 July 2008 11:49 Go to previous messageGo to next message
Shaheer
Messages: 50
Registered: June 2008
Location: Pakistan
Member
Respected Sir,
Please tell me how to split and store financial Year because Financial Year in the one field. How to split Data from one field.
Re: Enter Dates according to Financial Year [message #331841 is a reply to message #331766] Sat, 05 July 2008 21:58 Go to previous messageGo to next message
urnikhil
Messages: 42
Registered: March 2008
Member
U can use substr(sub-string) function to break value in that field.

if your value = 2008-09 then

part1 := substr(value,1,4);
part2 := substr(value,6,7);

- Nik.
Re: Enter Dates according to Financial Year [message #331852 is a reply to message #331841] Sun, 06 July 2008 01:39 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
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.
Re: Enter Dates according to Financial Year [message #331854 is a reply to message #331766] Sun, 06 July 2008 01:39 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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.



Re: Enter Dates according to Financial Year [message #331857 is a reply to message #331856] Sun, 06 July 2008 01:45 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Ah, sorry. I thought it meant month 09 of year 2008.
I've never seen that kind of notation in any financial system. Might be a locale thing.
Re: Enter Dates according to Financial Year [message #331866 is a reply to message #331857] Sun, 06 July 2008 03:16 Go to previous message
Shaheer
Messages: 50
Registered: June 2008
Location: Pakistan
Member
Thankyou Sir for giving solution. I correct that problem and my form works fine. Cool
Previous Topic: Duplicate records to database when entering data from form
Next Topic: Form
Goto Forum:
  


Current Time: Fri Dec 13 00:26:30 CST 2024