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

help in using yeartodate and monthtodate in selection formula

Status
Not open for further replies.

reacha

Programmer
Jun 9, 2010
83
US
I am trying to use this in my selection criteria
but when i run the report for monthly the values were not correct

Is this the correct formula to use

Year ({Command.AuditStampEntered}) = 2010 and
(
if {?Time Period} = 'Weekly' then ({Command.AuditStampEntered} = WeekToDateFromSun)

else if {?Time Period} = 'Monthly' then ({Command.AuditStampEntered} = MonthToDate)

else if {?Time Period} = '6Months' then ({Command.AuditStampEntered} >= dateadd("m",-6,currentdate)
and {Command.AuditStampEntered} <= currentdate)
else if {?Time Period} = 'Yearly' then ({Command.AuditStampEntered} = YearToDate)

)


Please help me out

Thanks,
reacha
 
Year ({Command.AuditStampEntered}) = 2010 and
(
if {?Time Period} = 'Weekly' then {Command.AuditStampEntered} = WeekToDateFromSun else
if {?Time Period} = 'Monthly' then {Command.AuditStampEntered} = MonthToDate else
if {?Time Period} = '6Months' then
(
{Command.AuditStampEntered} >= dateadd("m",-6,currentdate) and
{Command.AuditStampEntered} <= currentdate
) else
if {?Time Period} = 'Yearly' then {Command.AuditStampEntered} = YearToDate
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top