Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number of days in a mont for a year 1

Status
Not open for further replies.

thisisboni

Programmer
Jun 1, 2006
113
US
Hi:

I'm on CR 10 and Oracle 9i

in a table I have a varchar field as 'yyyy_mm'.
It contains the4 digit year value and the month value separated by '-' eg: 2006-02, 2006-11, etc...

I was looking to find the number of days that month for that year had ... that is ... for 2006-02 ... it is 28,
2006-11 it is 30 etc..

Please let me know if there is an inbuilt function and/or any custom function.

Thanks
 
No built in function for this, create a formula of:

whileprintingrecords;
numbervar days:=0;
datevar TheDate := dateserial(val(left({table.field},4)),val(mid({table.field},6,2))+1,1)-1;
day(TheDate)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top