spining123
Technical User
I created a formula to check for null fields. I have two number fields that I'm trying to add a slash "/" between the two fields. The problem is that all the fields are to be concatenated as one field; else it would be easier to use the Format Field for each field. But this is a run on report. I also need to format the data in both fields. The number fields are defined in my Microsoft Access table as
data type = number
field size = long integer
format = general number
decimal places = 0.
List is the code in my formula:
stringvar Fld4 := "";
numbervar Fld5 := 0;
numbervar Fld6 := 0;
OutContainerandItem := 0;
stringvar theslash := "/";
If isnull ({tblOne.FormofMaterial})
then Fld4 := ""
else Fld4 := ({tblOne.FormofMaterial}));
If isnull ({tblOne.Container})
then Fld5 := 0
else Fld5 := ({tblOne.Container});
If isnull({tblOne.ItemCount})
then Fld6 := 0
else Fld6 := ({tblOne.ItemCount});
If isnull ({tblOne.SpanYearBg})
then Fld7 := ""
else Fld7 := ({tblOne.SpanYearBg}));
At this point is where I have the problem trying to insert a slash "/" between the two number fields (if both fields are not equal to 0) and change the display of the data. The data in the number fields look like 34.00 5.00
I would like for the display to look
like 34 5
I get a string error with the trim command and concatenating the slash. I tried using totext(OutContainerAndItem) also.
If Fld5 <> 0 And Fld6 <> 0 Then
OutContainerAndItem = ((rtrim(Fld5),3) & "/" & (rtrim(Fld6),3))
Else
If Fld5 <> 0 And Fld6 = 0 Then
OutContainerAndItem = (rtrim(Fld5),3)
Else
If Fld5 = 0 And Fld6 <> 0 Then
OutContainerAndItem = (rtrim(Fld6),3) ;
Yes I'm lost....Any help is truly appreciated
data type = number
field size = long integer
format = general number
decimal places = 0.
List is the code in my formula:
stringvar Fld4 := "";
numbervar Fld5 := 0;
numbervar Fld6 := 0;
OutContainerandItem := 0;
stringvar theslash := "/";
If isnull ({tblOne.FormofMaterial})
then Fld4 := ""
else Fld4 := ({tblOne.FormofMaterial}));
If isnull ({tblOne.Container})
then Fld5 := 0
else Fld5 := ({tblOne.Container});
If isnull({tblOne.ItemCount})
then Fld6 := 0
else Fld6 := ({tblOne.ItemCount});
If isnull ({tblOne.SpanYearBg})
then Fld7 := ""
else Fld7 := ({tblOne.SpanYearBg}));
At this point is where I have the problem trying to insert a slash "/" between the two number fields (if both fields are not equal to 0) and change the display of the data. The data in the number fields look like 34.00 5.00
I would like for the display to look
like 34 5
I get a string error with the trim command and concatenating the slash. I tried using totext(OutContainerAndItem) also.
If Fld5 <> 0 And Fld6 <> 0 Then
OutContainerAndItem = ((rtrim(Fld5),3) & "/" & (rtrim(Fld6),3))
Else
If Fld5 <> 0 And Fld6 = 0 Then
OutContainerAndItem = (rtrim(Fld5),3)
Else
If Fld5 = 0 And Fld6 <> 0 Then
OutContainerAndItem = (rtrim(Fld6),3) ;
Yes I'm lost....Any help is truly appreciated