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!

date formula

Status
Not open for further replies.

tazibc

Instructor
Oct 5, 2007
66
GB
Pls can some one help I have a date feild and I want to run a report over a week period with out the use of parameters so the report will only give me a weeks worth of data.

{date.feild} how can this be done pls help
 
If you want to select all dates fro the current week then create 2 formulas

//@WeekStart - Returns Monday of the week
Today - (DayOfWeek (Today,crMonday) - 1)

//@WeekEnd - Returns Sunday of the week
Today - (DayOfWeek (Today,crMonday) + 7)

Then use these in the record selection formula

{MyTable,date} >= {@WeekStart}
and {MyTable.date} <= {@WeekEnd}

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
when i run this formula it brings back blank values on my report.

I have created both formulas as suggested and put them in my record selection formula below:-

{Weekday_Hub_Data.Arrivals, Vehicle Route ID} <> "" and
{Weekday_Hub_Data.Late Trunk, Reason Code} <> "" and
{Weekday_Hub_Data.Late Trunk, Inbound/Outbound} in ["IN", "OUT"] and
{Weekday_Hub_Data.Date} >={@Weekstart}and{Weekday_Hub_Data.Date}<={@Weekend};

this bings my report back as blank i used to run my report using prameters but now have deleted them as i would like to atomtae my report in businness objects. In order for me todo this i need to crack the weekly data issue as suggested.

thanks

Taz

any further suggestions
 
Do you mean last 7 days? If yes then use

{datefield} > currentdate-7

If you mean current week

datepart("ww", {datefield}) = datepart("ww", currentdate)

Ian
 
All I need the report to give me is the previous weeks data from Sat to Sun.

Ive tried the above fromulas but with no success
 
That is not what you said in your originla post!!

In select expert

{datefield}) in lastfullweek

Ian
 
//@WeekStart - Returns Monday of the week
(Today - (DayOfWeek (Today,crSaturday) - 1))-7

//@WeekEnd - Returns Sunday of the week
(Today - (DayOfWeek (Today,crSaturday) + 7))-7

Gary Parker
MIS Data Analyst
Manchester, England
 
Please identify your week again. You have said Sat to Sun, which is nine days, not seven.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top