Feb 3, 2005 #1 Steve95 MIS Joined Nov 3, 2004 Messages 265 Location 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
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
Feb 3, 2005 #2 Nuffsaid Technical User Joined Aug 3, 2001 Messages 374 Location CA Hi, {Table.Date}=WeekToDateFromSun Nuffsaid. Upvote 0 Downvote
Feb 3, 2005 #3 TheBlondOne Programmer Joined May 22, 2001 Messages 346 Location GB There's a week to date from sunday function. The code for this is WeekToDateFromSun HTH Upvote 0 Downvote
Feb 4, 2005 Thread starter #4 Steve95 MIS Joined Nov 3, 2004 Messages 265 Location US 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 Upvote 0 Downvote
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
Feb 4, 2005 1 #5 lbass Technical User Joined Feb 9, 2002 Messages 32,818 Location US 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 Upvote 0 Downvote
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
Feb 4, 2005 #6 BobSuruncle Technical User Joined Jun 18, 2002 Messages 423 Location CA 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 Upvote 0 Downvote
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