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

week array

Status
Not open for further replies.

Regelos

Programmer
Nov 16, 2005
35
0
0
US
I need to setup a group on a 13week rolling date field problem I am having is I dont have the full date field in the data source + I cant modify my sql tables to add a date collum where I need it the solution I came up with I can carry out if I am able to group on weeks so what I need to do is come up with an array I can group on that takes the current date and extends it by 13 and posts all 13 in between. any ideas?
 
It was hard to understand your problem. You MUST have a date associated with each record or at least something that can be converted into a date. Without that, this can't be done.

Assuming you have a date field, you need to pick a start date either by hard-coding it or by creating a paramter.

Next create a formula that subtracts the date in the record and start date and divide the differnce by 91 (13* 7 = 91)
take the integer value of it. Here is the code:

INT(({table.date}-{@start_date})/91)

Group on this formula field.



Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top