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

Parameter Manipulation

Status
Not open for further replies.

kutoose

Technical User
Sep 11, 2002
169
US
I have a parameter field - This parameter field is NUMBER. This is a concatenation of Month (number) and Year (Number)

I need to split this field into two - I need to compare the last four digits of the parameter to a field and the remaining to another field.

The parameter values are like


12004
22004
32004
42004
52004
62004
72004
82004
92004
102004
112004
122004
12005
.
.
.
etc
Table.Month(Number) = MonthPart of Parameter;
Table.Year(Number) = YearPart of Parameter;

How can this be achieved?
I am using Crystal Reports 10 ;

Database Oracle 9






kutoose@yahoo.com
 
To get the year:
{?Number} Mod 10000
or
Remainder({?Number},10000)

To get the month:
Int({?Number}/10000)
or
Truncate({?Number}/10000)

-dave
 
Or try:

if len(totext({?MyParm},0,"")) = 6 then
Table.Month = val(left(totext({?MyParm},0,""),2))
and
Table.Year = val(mid(totext({?MyParm},0,""),3))
else
Table.Month = val(left(totext({?MyParm},0,""),1))
and
Table.Year = val(mid(totext({?MyParm},0,""),2))

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top