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!

CurrentWeek 1

Status
Not open for further replies.

Steve95

MIS
Nov 3, 2004
265
US
Hi All

plz can someone inform me is their a command like currentdate but one for currentweek? If so what is it?

Kind Regards
Shin
 
There's a week to date from sunday function. The code for this is

WeekToDateFromSun

HTH
 
Sorry my mistake I came across wrong....

What i have is a chart forecasting until end of the year. The data stored in the db is only stored from current week onwards.

What I want to acheive is to have a formula that picks up the current week and then adds 52 weeks regardless of time of the year!

eg. we are in week 5 with this formula in place it will show projections for each week upto 52 weeks from currentdate taking us into ealy next year.

Thanks in advance
Shin
 
To show data for next 52 weeks from today, use:

{table.date} in currentdate to dateadd("ww",52,currentdate)

To show data from the beginning of the current week, use:

{table.date} in currentdate - dayofweek(currentdate)+1 to
dateadd("ww",52,currentdate - dayofweek(currentdate))

-LB
 
If you wanted 52 weeks out from today, starting at Sunday of the current week, you could try something like this:

Code:
{YourTable. Date} in
DateAdd ('d',DayOfWeek(CurrentDate)-(DayOfWeek(CurrentDate)-1) ,CurrentDate )
to 
DateAdd ('ww',52 ,CurrentDate )
This gets passed in Where clause in CR10
HTH


Bob Suruncle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top