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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display weeks in between two dates?

Status
Not open for further replies.

nmmure

Programmer
Jun 8, 2006
200
US
Hi,
How to convert two dates into weeks like i have fromdate and todate. example : "july/13/2001" & "May/1/2005". how to display weeks in between two dates? iam facing the problem to prepare chart report between "Weeks" and "%" between the weeks i need to calculate the % & display the report.

Thanks
Mure
 
here is a formula that you be looking for -- cheers !

Local DateVar Start := Date (2006,7,13); // place your Starting Date here
Local DateVar End := Date (2006,7,27); // place your Ending Date here
Local NumberVar Weeks;

Weeks:= (Truncate (End - dayofWeek(End) + 1 - (Start - dayofWeek(Start) + 1)) /7 );

Weeks;
 
Hi,

iam receiving 2 date (Fromdate & Todate) from java(Front End).my problem is i need to fetch the data from database weekwise and display the data in the report.
Generally in the where condition we are using the condition "WHERE TableName.ColumnName between {fromdate} and {todate}" and fetch the data,complete data will come in between these two dates upto this okay, i need to do sum & avg weekwise, this can we do in java, like breaking the date week wise & calculate the Sum and Avg.

Is this possible in Crystall report side? In formuala editor i seen where, for, if loops, is it possible in Crystal side. i think this can we do in SQL Query but i don't know how to do this, iam trying. pls any one have idea help me.

Any help is appreciated.

Thanks in advance
Mure
 
Using 2 dates I am printing the records. My client is asking Chart report week wise in between those 2 dates. Ex: select * from table-name where Assign_Date between {?fromdate} and {?todate} I am displaying the report.
How to break the records in week wise and calculate the sum and avg based on that values i will do the chart report. Here my application is front end java. From the java we can do this one using control structures, But the source code is not there, that is my big problem.
Is there any chance to do this in SQL Query or in Crystal? Please help me any one have idea, any help is appreciated.

Thanks in advance
MURE
 
Hi,
Thanks a lot, i got the idea, I did this.

Thanks a lot once again..

Mure
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top