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 John Tel 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
 
Is there any crystal function for this? please help me..

Thanks in Advance
 
DateDiff("w",StartDate,EndDate) should give you the number of weeks between 2 dates.

Bob Suruncle
 
Hi,

iam receiving 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 "Date 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 data.

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 iam working on that. pls any one have idea help me.

Any help is appreciated.

Thanks in advance
Mure
 
If I understand correctly, you want to sum the values on your report by week.
If this is the case, greate a group on the date field, and set it to break on week.(choices are by day, week, 2 weeks, month, quarter, etc.)
Then just create your summaries as you would normally (i.e. right-click the field to be summarised, choose Insert Summary, and pick the summarisation method)


Bob Suruncle
 
Hi,
Can you please explain me how to do that..I don't know how to do that one In between 2 dates,iam in confusion, One date we can do that one, in between how to do please guide me.
Thanks for your help.
 
My exact problem is,
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
 
Try inserting the chart, add {table.Assign_Date} as your "on change of" field in the advanced chart and while it is highlighted->order->choose print: for each week. Add the sum and average summaries in the show value area.

-LB
 
Hi,
Thanks a lot,
As per my knowledge i am thinking very complicated logic,
Your answer is solved this is one in very simplest way,

Thanks a lot for u r help.

Mure
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top