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

Flexibility and SQL tables

Status
Not open for further replies.

Zbob

MIS
Apr 25, 2002
94
0
0
US
I have a few flex projects that use the pervasive table names, and in preparation of an SQL upgrade I was working on changing to the _sql tables, what I found was the macform.no.text does not have the 2 leading zeros that the oeordlin_sql has.

Am I missing something or is there any easy way to concatenate 2 zeros on the ord number.

Thanks,

zbob
 
This will pad it out
Dim sOeNum as string
Dim sNewOeNum as String

sOeNum=macform.no.text
sNewOeNum=sOeNum

For i=1 to 8-len(trim$(sOeNum)) '8 is the length of
'the OEORDLIN_SQL order_no fiel
sNewOeNum="0"+sNewOeNum
Next i



 
How about

Dim sOeNum as string
sOENum = Format(stOeNum, "00000000")


Sorry vbajock....just like less lines of code.

Andy

Andy Baldwin
 
Just a little more FYI...

The same 'Format..' technique works well for padding the Customer No and/or Vendor No (assuming you are using numeric values for those!), PP Order No, SF Ord No, etc.

Watch out for the PO_No (Purchase Order No.. see POORDHDR_SQL). It is eight characters, with the first six characters as the PO Number (left padded with zeros) followed by a two character Release No.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top