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!

Select Export Error - String required here 1

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
This is the formula that I'm using below. I'mjust basically controlling what PO Number. If the user does not enter a PO then all PO numbers need to display from the {SF_ProductionOverview_TTX.Customer_PO} field, else the {SF_ProductionOverview_TTX.Customer_PO} field must equal the @PONUMBER.

I keep getting a String is required here in the ELSE statement.

if {@PONUMBER} <>{SF_ProductionOverview_TTX.Customer_PO} then {SF_ProductionOverview_TTX.Customer_PO}
else {SF_ProductionOverview_TTX.Customer_PO} = {@PONUMBER}
 
Is this a record selection formula?

What is the content of {@PONUMBER} (and of any nested formulas within it)? It sounds like there is a parameter in there somewhere.

What is the datatype of {@PONUMBER} and of the Customer_PO field? It appears that one is a string and one a number.

-LB
 
Great questions. The datatype of @PONUmber is text. The content of this information in this formula passed from a entry field on a entry page stored as a cookie. SO this field might have an entry of (ac123414) for example or it would be NULL.
 
Please answer all questions.

By content, I meant please show the actual formula.

-LB
 
Oh. The actual formula in the @PONUMBER is being read from a cockie from another app.


For example:
' Read Cookies from Filter
ThruDate = GetCookieValue("ThruDate")
Customer = GetCookieValue("Customer")
Part = GetCookieValue("Part")
'AllDeliv = cBool(GetCookieValue("AllDeliv")) SortBy = cInt(GetCookieValue("optSort"))
PONumber = GetCookieValue("PONumber")

' Expire Cookies
document.cookie = "ThruDate=;" & sExpCookie
document.cookie = "Customer=;" & sExpCookie
document.cookie = "Part=;" & sExpCookie
'document.cookie = "AllDeliv=;" & sExpCookie rick 8/18/2010
document.cookie = "optSort=;" & sExpCookie
document.cookie = "PONumber=;" &sExpCookie




' Set Report Formulas
Set oFormulaFields = oRpt.FormulaFields
For i = 1 To oFormulaFields.Count
Set FirstFormula = oFormulaFields.Item(i)
If UCase(FirstFormula.Name) = "{@DATERANGE}" Then FirstFormula.Text = "'" & SetDateRange("",ThruDate) & "'"
If UCase(FirstFormula.Name) = "{@BSHOWFULLDELIVERY}" Then FirstFormula.Text = AllDeliv
If UCase(FirstFormula.Name) = "{@OPTSORTBY}" Then FirstFormula.Text = SortBy
If UCase(FirstFormula.Name) = "{@PONUMBER}" Then FirstFormula.Text = "'"& PONumber &"'"
Next
 
Please answer the other questions:

Is this a record selection formula?

What is the datatype of Customer_PO field?

-LB
 
This is a Record Selection formula.
Data type of the Customer PO field is String.
 
Try:

(
if isnull({@PONUMBER}) or
trim({@PONUMBER}) = "" then
true else
{SF_ProductionOverview_TTX.Customer_PO} = {@PONUMBER}
)

-LB
 
Thanks, I changed it to this and it is wonderfull!!

What specifically does..if isnull({@PONUMBER}) or trim({@PONUMBER}) = "" then true..do?

if isnull({@PONUMBER}) or trim({@PONUMBER}) = "" then true

else {SF_ProductionOverview_TTX.Customer_PO} = {@PONUMBER}
 
It checks to see if the formula is null or empty. If a space was entered, the trim() removes it so that it is the equivalent of empty. The "then true" allows all values to be accepted in this case. Otherwise, the formula must equal the selection.

-LB
 
Thanks Ibass. That is truly appreciatted!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top