Home » Developer & Programmer » Forms » Year Date's and days come in form (Developer 6I database 10g window xp)
Year Date's and days come in form [message #409805] Wed, 24 June 2009 02:46 Go to next message
shahzaib_4vip@hotmail.com
Messages: 376
Registered: December 2008
Location: karachi
Senior Member
Dear all

I have 2 Column 1 is Date and 2nd is Day

And i have one Button i need when i enter button then its show all year date in date column and day in day column for example

Date---------Day
1-jan-2009-Thursday 
2-jan-2009-Friday
3-jan-2009-Saturday 


And As on

I hope you guys understand

Regards

Shahzaib ismail
Re: Year Date's and days come in form [message #409892 is a reply to message #409805] Wed, 24 June 2009 06:47 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Great!
What is your code?

Search for row generator to get a sample code.

By
Vamsi
Re: Year Date's and days come in form [message #410089 is a reply to message #409805] Thu, 25 June 2009 03:03 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 376
Registered: December 2008
Location: karachi
Senior Member
DECLARE
	Dt_Date DATE;
BEGIN
	GO_BLOCK ('block3');
	CLEAR_BLOCK(NO_VALIDATE);
	FIRST_RECORD;
	Dt_Date := TO_DATE('01-JAN-2009');
	LOOP
		:block3.ok := TO_CHAR(Dt_Date, 'DD-MON-YYYY');
		:block3.DAY  := TO_CHAR(Dt_Date, 'DAY');
		EXIT WHEN TO_CHAR(Dt_Date, 'YYYY') <> TO_CHAR(dt_date + 1, 'YYYY');   -- If next year reaches, exit from the loop.
		Dt_Date := Dt_Date + 1;
		NEXT_RECORD;
	END LOOP;
END;	



This is my code and its work Perfectly


Regards

Shahzaib ismail
Re: Year Date's and days come in form [message #410093 is a reply to message #410089] Thu, 25 June 2009 03:20 Go to previous message
nagu_bhat
Messages: 10
Registered: May 2009
Junior Member
Hi

here is a simpler code for u

select to_char(trunc(sysdate,'YYYY') + level -1,'DD-MON-YYYY') ok,
to_char(trunc(sysdate,'YYYY') + level -1,'DAY') day
from dual
connect by level <= ((add_months(trunc(sysdate,'YYYY'),12)-1) -
trunc(sysdate,'YYYY'))
/


you can even put this is the block using from clause query.

Regards
Nagaraj

Previous Topic: Merged two crappy titles - 3 very important questions and Why not Answered?????
Next Topic: dates problem
Goto Forum:
  


Current Time: Sat Dec 10 09:00:17 CST 2016

Total time taken to generate the page: 0.21016 seconds