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

asset year -1 1

Status
Not open for further replies.

fsreport

Programmer
Mar 23, 2007
128
US
hi All
cr 9.0
ms sql
i have table and the month is number and year is number
and a parameter call month and the other year

if i want from from PYTD
is this ok
if {ASSET_HISTORY.ASSET_MONTH} in [1 to {ASSET_HISTORY.ASSET_MONTH}]
and {ASSET_HISTORY.ASSET_YEAR} in [{?Asset_Year}-1]
then
round({ASSET_HISTORY.CURR_SHR_DOL})
else
0
i want to have the
{ASSET_HISTORY.ASSET_YEAR} in [{?Asset_Year}-1]
go back 1 year
ex: if they select 2007
i want the {?Asset_Year} -1] to equal 2006

Thanks



fsreport
 
Hi,
If only 1 value is being tested against, the IN operator is not needed..
so,
Code:
and {ASSET_HISTORY.ASSET_YEAR} = ({?Asset_Year}-1)

should do what you want..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
hi
thanks for the replied
PYTD
they want now
{ASSET_HISTORY.ASSET_YEAR} in [{?Asset_Year} -1 to {?Asset_Year}]
in my record selection i added this
{ASSET_HISTORY.ASSET_YEAR} in [{?Asset_Year} -1 to {?Asset_Year}]
that should work to get 2006 to 2007


fsreport
 
Hi,
Or:
{ASSET_HISTORY.ASSET_YEAR} >= ({?Asset_Year}-1)

More than 1 way to skin a cat -
Look at the Sql genersted by each choice and see which seems to be more efficient ( that is, which form passes the work to the database for processing of the where clause)

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top