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

5 day week problem 1

Status
Not open for further replies.
Sep 12, 2005
448
US
Hi All
cr 9.0
ms sql

i have a report that used an {?End_Date} parameter.
i need to report for 5 days base on the {?End_Date}
they enter
here is the problem
if they enter let say 02/15/2007
witch is monday
i need to report from monday 15 to monday 15 only
if the select 02/23/2007 this would be friday
i need to report from monday 15 to friday 23
all depends on what day they enter of the week.
how can i do this base apound my parameter
and it only for that week period
thanks





Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
2/15/2007 is not a Monday. Please spend more time on your making your initial posts accurate.

-LB
 
Hi -Lb
Sorry about that error :)
i have a report that used an {?End_Date} parameter.
i need to report for 5 days base on the {?End_Date}
here is the problem
if they enter let say 02/5/2007 on the parameter
witch is monday
i need to report from monday 5 to monday 5 only
if the select 02/9/2007 this would be friday form the paramter
i need to report from monday 5 to friday 9
all depends on what day they enter of the week.
Could be any day during that 5 day week
how can i do this base apound my parameter
and it only for that week period of 5 days

thanks

Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
Use a record selection formula like:

{table.date} in {?enddate}-dayofweek({?enddate})+2 to {?enddate} and
dayofweek({table.date}) in 2 to 6

The last line ensures that if they choose a Saturday, that only data from Monday to Friday is returned. If a Sunday is selected, no data will be returned.

-LB

 
Thanks -Lb
I appreciate your help
your the best 'Girl' :)

Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
Hi -Lb
i tried it and i get more than the 5 day record return

i created a formula for the WEEK_SLS
@WEEK_SLS
--------------------------------------
{TRANSACTION_HISTORY.POSTING_DATE} in Date(year({?End_Date}),1,1) to
date(year({?End_Date}),Month({?End_Date}),Day({?End_Date}))

-------------------------------------------
in my record slection i have this

{TRANSACTION_HISTORY.POSTING_DATE} in Date(year({?End_Date}),1,1) to
date(year({?End_Date}),Month({?End_Date}),Day({?End_Date}))


because i need to report on 2 other collumn
MTD_SLS and YTD_SLS

here are my formula
--------------------------------------
@MTD_SLS
if {TRANSACTION_HISTORY.POSTING_DATE} in Date(year({?End_Date}),month({?End_Date}),1) to
{?End_Date}
and
{TRANSACTION_HISTORY.TRADE_CLASS} = "S"
then
{TRANSACTION_HISTORY.GROSS_AMOUNT
else
0
-------------------------------------------
@YTD_SLS
if
{TRANSACTION_HISTORY.POSTING_DATE} in Date(year({?End_Date}),1,1) to
Date(Year({?End_Date}),Month({?End_Date}),day({?End_Date}))
and
{TRANSACTION_HISTORY.TRADE_CLASS} = "S"
then
{TRANSACTION_HISTORY.GROSS_AMOUNT
else
0
---------------------------------------------
thats why i need to add
{TRANSACTION_HISTORY.POSTING_DATE} in Date(year({?End_Date}),1,1) to
date(year({?End_Date}),Month({?End_Date}),Day({?End_Date}))

because i need to report on 2 other collumn
MTD_SLS and YTD_SLS

or should i remove the above from my record selection???
when i remove it my report freeze and does not reponse





Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
You just need another conditional formula:

//{@weektodate}:
if {TRANSACTION_HISTORY.POSTING_DATE} in {?enddate}-dayofweek({?enddate})+2 to {?enddate} and
dayofweek({TRANSACTION_HISTORY.POSTING_DATE}) in 2 to 6 and
{TRANSACTION_HISTORY.TRADE_CLASS} = "S" then
{TRANSACTION_HISTORY.GROSS_AMOUNT}

Leave your record selection formula as is. Note that your post is incorrect again, showing the same formula for your record selection as for your {@week_sls}. Please use "preview post" before submitting so you can review your post and edit before submitting. Thanks.

-LB
 
Hi -Lb
Sorry about that they have be bouncing from one project to an other here
and they want everything done for yesterday

thanks again


Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
Hi -LB
i did post an other problem and no answer on the ranking problem i have
in crystal report 4 other topics
many thanks
:)
have a nice day

Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top