unconcatenated

  • Thread starter Thread starter Haggr via AccessMonster.com
  • Start date Start date
This newsgroup is manned by humans, not machines.

Perhaps you can explain what it is you're looking for in a little more
detail...
 
I get data from an external source (beyond my control) that I use in my
program. One field is a concatenated string. I need to unconcatenat that
string to get to a (root item number). That program is written in "Cobol"

Rule A: String should end with a number, except when there is a "W" then
should end in "W"
ex (xlb114r) = (xlb114) or (xlb114wr) = (xlb114w)

Rule B: If string contain "/" , string before "/" should end with a number,
then the "/" and any number and/or "W"
ex (xmr115/4sy) = (xmr115/4) or (amr115/4syw) = (xmr115/4w)

Rule B-2: If after "/" there is not any numbers and/or "W" the apply Rule A
without the "/"
ex (xs12pt/aa) = (xs12) or (xs12pt/aaw) = (xs12w) "notice no "/"

Rule C: string with "-", Apply Rule A and keep "-" and everthing after "-"
ex (xan72aa-7.5) = (xan72-7.5)

Here is what I have so far. This handles Rule A fine, but not the others

Public Function fGetFirstChars_Nums_w(pString As Variant) As String
On Error GoTo Err_fGetFirstCharsNums
Dim i As Integer
Dim boolNum As Boolean
Dim ch As String
Dim tmp As String

If Len(Trim(pString & "")) > 0 Then
For i = 1 To Len(pString)
ch = MID(pString, i, 1)
Select Case ch
Case "0" To "9"
If boolNum = False Then boolNum = True
tmp = tmp & ch
Case "w"
tmp = tmp & ch
If boolNum = True Then Exit For
Case "-", "/"
tmp = tmp & ch & tmp
If boolNum = True Then Exit For
Case Else
If boolNum = False Then
'no number char yet
tmp = tmp & ch
Else
Exit For
End If
End Select

Next
Else
tmp = vbNullString
End If

fGetFirstChars_Nums_w = tmp

Exit_fGetFirstCharsNums:
Exit Function

Err_fGetFirstCharsNums:
MsgBox Err.Description
Resume Exit_fGetFirstCharsNums
End Function
 
Try this:

'******Start of code*******
Public Function fGetFirstChars_Nums_w(pString As Variant) As String
Dim tmp As String
Dim strRemStr As String
Dim strNxtChar As String
Dim strPrevChar As String
Dim strW As String
Dim bytChrLoc As Byte
Dim bytWLoc As Byte
Dim bytRemLen As Byte
Dim bytStrLen As Byte
Dim strHyphen As String
Dim cntr
Dim NoNumber As Boolean
Dim NoW As Boolean

'set the values of the flags
NoNumber = False
NoW = False
If Len(Trim(pString & "")) > 0 Then
'rule "B" - if the string contains a "/"
bytChrLoc = InStr(1, pString, "/")
If bytChrLoc > 0 Then
'the following code will loop until the
'previous character is numberic
FindLastNum:
'Character before the "/" must be a number
strPrevChar = Mid(pString, bytChrLoc - 1, 1)
If IsNumeric(strPrevChar) Then
tmp = Left(pString, bytChrLoc - 1)
'next check for any number following the "/"
strRemStr = Right(pString, Len(pString) - bytChrLoc)
bytRemLen = Len(strRemStr)
For cntr = 1 To bytRemLen
strNxtChar = Mid(strRemStr, cntr, 1)
If IsNumeric(strNxtChar) Then
strNxtChar = Mid(strRemStr, cntr, 1)
tmp = tmp + "/" + strNxtChar
GoTo ChkForLetterW
End If
Next cntr
If cntr = bytRemLen + 1 Then
NoNumber = True
End If
ChkForLetterW:
'check to see if the letter "W" exists
'in the remainin g string
bytWLoc = InStr(1, strRemStr, "W")
If bytWLoc > 0 Then
'read the "W" string from the string (no matter
' if it is a capital "W" or not it will still be
' the same character
strW = Mid(strRemStr, bytWLoc, 1)
tmp = tmp + strW
Else
NoW = True
End If
'rule "B-2" - if there is no number following the "/" and
' there is no "W" following the "/"
'use rule "A"
If NoNumber = True And NoW = True Then
GoTo RuleA
End If
'the rules for "B" have been applied and the string is ready
GoTo ReturnString
Else
'try to find the last number in the string
bytChrLoc = bytChrLoc - 1
GoTo FindLastNum
End If
Else
tmp = pString
End If

'rule "C" - if the string contains a "-"
bytChrLoc = InStr(1, tmp, "-")
If bytChrLoc > 0 Then
strHyphen = Right(tmp, Len(tmp) - (bytChrLoc - 1))
tmp = Left(tmp, bytChrLoc - 1)
Else
strHyphen = ""
End If
RuleA:
'rule "A" - String must end with a number except when
' there is a "W" in the string
bytChrLoc = InStr(1, tmp, "w")
If bytChrLoc > 0 Then
tmp = Left(tmp, bytChrLoc)
Else
strPrevChar = Right(tmp, 1)
If strPrevChar = "w" Then
'read the "W" string from the string (no matter
' if it is a capital "W" or not it will still be
' the same character
strW = Right(tmp, 1)
tmp = tmp + strW
Else
If IsNumeric(strPrevChar) Then
GoTo ReturnString
Else
cntr = 1
ChkPrevChr:
strPrevChar = Mid(tmp, Len(tmp) - cntr, 1)
If IsNumeric(strPrevChar) Then
tmp = Left(tmp, Len(tmp) - cntr)
Else
'decrement the "bytStrLen" variable
If cntr > 0 Then
cntr = cntr + 1
GoTo ChkPrevChr
End If
End If
End If
End If
End If
If strHyphen > "" Then
tmp = tmp + strHyphen
Else
tmp = vbNullString
End If
End If

ReturnString:
fGetFirstChars_Nums_w = tmp
End Function
'******End of Code******

I did test each of the values you posted and this funciton will return the
values you are looking for in each case.

There is no error handling code and you may need to evaluate any instances
where the characters in the string may not be in the exact order.
 
Having trouble with Rule C, (xan72aa-7.5) returns (xan72) or (xs123pt-e)
returns (xs123).
When there is a "-" Use Rule A and keep the "-" and any characters that
follows.

ex (xan72aa-7.5) = (xan72-7.5) or (xs123pt-e) = (xs123-e)
 
Haggr,

I am at a loss as to what to tell you.

I have tested the function here with the exact strings that you provided and
the function returns the string values that you show in your examples.

Are you placing a breakpoint in the code to see where the problem may be
occuring.

As I say, when I pass in the "xan72aa-7.5" value, the function returns:
"xan72-7.5".
If I pass in the "xs123pt-e" value, the function returns: "xs123-e".

If this is not what you are wanting to be returned, then I may have
misunderstood.
 
Your right I posted a message over at Microsoft saying that it did work. I
thought you might see it here also since I seen your reply there.
But Rule A doesn't work.
Ex (xsw124aa) should return (xsw124) or (xsw124waa) should return (xsw124w)

Thanks for all your help. How do you know this stuff, did you write "Access"!
!!

Mr said:
Haggr,

I am at a loss as to what to tell you.

I have tested the function here with the exact strings that you provided and
the function returns the string values that you show in your examples.

Are you placing a breakpoint in the code to see where the problem may be
occuring.

As I say, when I pass in the "xan72aa-7.5" value, the function returns:
"xan72-7.5".
If I pass in the "xs123pt-e" value, the function returns: "xs123-e".

If this is not what you are wanting to be returned, then I may have
misunderstood.
Having trouble with Rule C, (xan72aa-7.5) returns (xan72) or (xs123pt-e)
returns (xs123).
[quoted text clipped - 209 lines]
 
Haggr,

There was a flaw in the assumptions for Rule A.

I have tested the function below against all of your examples and it returns
values in each case that are equal to your examples.

I have modified the function:

'****Start of Code*****
Public Function fGetFirstChars_Nums_w(pString As Variant) As String
Dim tmp As String
Dim tmpStr As String
Dim strRemStr As String
Dim strNxtChar As String
Dim strPrevChar As String
Dim strW As String
Dim bytChrLoc As Byte
Dim bytWLoc As Byte
Dim bytRemLen As Byte
Dim bytStrLen As Byte
Dim strHyphen As String
Dim cntr
Dim NoNumber As Boolean
Dim NoW As Boolean

'set the values of the flags
NoNumber = False
NoW = False
If Len(Trim(pString & "")) > 0 Then
'rule "B" - if the string contains a "/"
bytChrLoc = InStr(1, pString, "/")
If bytChrLoc > 0 Then
'the following code will loop until the
'previous character is numberic
FindLastNum:
'Character before the "/" must be a number
strPrevChar = Mid(pString, bytChrLoc - 1, 1)
If IsNumeric(strPrevChar) Then
tmp = Left(pString, bytChrLoc - 1)
'next check for any number following the "/"
strRemStr = Right(pString, Len(pString) - bytChrLoc)
bytRemLen = Len(strRemStr)
For cntr = 1 To bytRemLen
strNxtChar = Mid(strRemStr, cntr, 1)
If IsNumeric(strNxtChar) Then
strNxtChar = Mid(strRemStr, cntr, 1)
tmp = tmp + "/" + strNxtChar
GoTo ChkForLetterW
End If
Next cntr
If cntr = bytRemLen + 1 Then
NoNumber = True
End If
ChkForLetterW:
'check to see if the letter "W" exists
'in the remainin g string
bytWLoc = InStr(1, strRemStr, "W")
If bytWLoc > 0 Then
'read the "W" string from the string (no matter
' if it is a capital "W" or not it will still be
' the same character
strW = Mid(strRemStr, bytWLoc, 1)
tmp = tmp + strW
Else
NoW = True
End If
'rule "B-2" - if there is no number following the "/" and
' there is no "W" following the "/"
'use rule "A"
If NoNumber = True And NoW = True Then
GoTo RuleA
End If
'the rules for "B" have been applied and the string is ready
GoTo ReturnString
Else
'try to find the last number in the string
bytChrLoc = bytChrLoc - 1
GoTo FindLastNum
End If
Else
tmp = pString
End If

'rule "C" - if the string contains a "-"
bytChrLoc = InStr(1, tmp, "-")
If bytChrLoc > 0 Then
strHyphen = Right(tmp, Len(tmp) - (bytChrLoc - 1))
tmp = Left(tmp, bytChrLoc - 1)
Else
strHyphen = ""
End If

RuleA:
'rule "A" - String must end with a number except when
' there is a "W" in the string
'find the last numeric value in the string
strPrevChar = Right(tmp, 1)
If IsNumeric(strPrevChar) Then
GoTo ReturnString
Else
bytRemLen = Len(tmp)
For cntr = 1 To bytRemLen
strPrevChar = Mid(tmp, Len(tmp) - cntr, 1)
If IsNumeric(strPrevChar) Then
tmpStr = Left(tmp, Len(tmp) - cntr)
GoTo ChkForExistingW
End If
Next cntr
End If
ChkForExistingW:
bytRemLen = Len(tmp) - Len(tmpStr)
strRemStr = Right(tmp, bytRemLen)
bytWLoc = InStr(1, strRemStr, "W")
If bytWLoc > 0 Then
'read the "W" string from the string (no matter
' if it is a capital "W" or not it will still be
' the same character
strW = Mid(strRemStr, bytWLoc, 1)
tmp = tmpStr + strW
Else
tmp = tmpStr
End If
If strHyphen > "" Then
tmp = tmp + strHyphen
End If
End If

ReturnString:
fGetFirstChars_Nums_w = tmp
End Function
'****End of Code****

And, No, I did not write Access, in fact, I am self-taught in using Access.
I have to give a lot of credit to the other folks who consistantly contribute
to these newsgroups. If it had not been for them and all of their help over
the years, I would never have been able to learn what I know about Access. I
learn something everyday.

--
HTH

Mr B


Haggr via AccessMonster.com said:
Your right I posted a message over at Microsoft saying that it did work. I
thought you might see it here also since I seen your reply there.
But Rule A doesn't work.
Ex (xsw124aa) should return (xsw124) or (xsw124waa) should return (xsw124w)

Thanks for all your help. How do you know this stuff, did you write "Access"!
!!

Mr said:
Haggr,

I am at a loss as to what to tell you.

I have tested the function here with the exact strings that you provided and
the function returns the string values that you show in your examples.

Are you placing a breakpoint in the code to see where the problem may be
occuring.

As I say, when I pass in the "xan72aa-7.5" value, the function returns:
"xan72-7.5".
If I pass in the "xs123pt-e" value, the function returns: "xs123-e".

If this is not what you are wanting to be returned, then I may have
misunderstood.
Having trouble with Rule C, (xan72aa-7.5) returns (xan72) or (xs123pt-e)
returns (xs123).
[quoted text clipped - 209 lines]
unconcatenated and concatenated string
 
You got it. The "Cobol" guys are going to crap. They wanted to help me,
they have that "Root Item Style", but their boss would not allow them to
alter [tabels] and they couldn't figure out how to add that [field] to my
downloadable file (tab-delimited) of all things. You right about one thing,
the people on this and other "Access" sites are totally selfless. Hope you
can help me do some tweaking to this function() "if needed", as the "Cobol"
boys admited, as time went on, they had to get creative to keep adding to
that string. Far as I can see, all "Root Items" are fine. Man if you only
knew how much this helps. Sincerely Thanks.

PS I'm a jewelry manufacturer. All those "aa" "pt" "7.5" refer to the
stones and sizes.
ex (xan72aa-7.5) = Anniversary Ring, AA quality diamonds, size 7.5
or (xmr113/4sy Mothers Ring with 4 stones

And I needed to get to the "root" for billing. Now it is just "scan and
click"

and "W" is White Gold

Thanks again

Mr said:
Haggr,

There was a flaw in the assumptions for Rule A.

I have tested the function below against all of your examples and it returns
values in each case that are equal to your examples.

I have modified the function:

'****Start of Code*****
Public Function fGetFirstChars_Nums_w(pString As Variant) As String
Dim tmp As String
Dim tmpStr As String
Dim strRemStr As String
Dim strNxtChar As String
Dim strPrevChar As String
Dim strW As String
Dim bytChrLoc As Byte
Dim bytWLoc As Byte
Dim bytRemLen As Byte
Dim bytStrLen As Byte
Dim strHyphen As String
Dim cntr
Dim NoNumber As Boolean
Dim NoW As Boolean

'set the values of the flags
NoNumber = False
NoW = False
If Len(Trim(pString & "")) > 0 Then
'rule "B" - if the string contains a "/"
bytChrLoc = InStr(1, pString, "/")
If bytChrLoc > 0 Then
'the following code will loop until the
'previous character is numberic
FindLastNum:
'Character before the "/" must be a number
strPrevChar = Mid(pString, bytChrLoc - 1, 1)
If IsNumeric(strPrevChar) Then
tmp = Left(pString, bytChrLoc - 1)
'next check for any number following the "/"
strRemStr = Right(pString, Len(pString) - bytChrLoc)
bytRemLen = Len(strRemStr)
For cntr = 1 To bytRemLen
strNxtChar = Mid(strRemStr, cntr, 1)
If IsNumeric(strNxtChar) Then
strNxtChar = Mid(strRemStr, cntr, 1)
tmp = tmp + "/" + strNxtChar
GoTo ChkForLetterW
End If
Next cntr
If cntr = bytRemLen + 1 Then
NoNumber = True
End If
ChkForLetterW:
'check to see if the letter "W" exists
'in the remainin g string
bytWLoc = InStr(1, strRemStr, "W")
If bytWLoc > 0 Then
'read the "W" string from the string (no matter
' if it is a capital "W" or not it will still be
' the same character
strW = Mid(strRemStr, bytWLoc, 1)
tmp = tmp + strW
Else
NoW = True
End If
'rule "B-2" - if there is no number following the "/" and
' there is no "W" following the "/"
'use rule "A"
If NoNumber = True And NoW = True Then
GoTo RuleA
End If
'the rules for "B" have been applied and the string is ready
GoTo ReturnString
Else
'try to find the last number in the string
bytChrLoc = bytChrLoc - 1
GoTo FindLastNum
End If
Else
tmp = pString
End If

'rule "C" - if the string contains a "-"
bytChrLoc = InStr(1, tmp, "-")
If bytChrLoc > 0 Then
strHyphen = Right(tmp, Len(tmp) - (bytChrLoc - 1))
tmp = Left(tmp, bytChrLoc - 1)
Else
strHyphen = ""
End If

RuleA:
'rule "A" - String must end with a number except when
' there is a "W" in the string
'find the last numeric value in the string
strPrevChar = Right(tmp, 1)
If IsNumeric(strPrevChar) Then
GoTo ReturnString
Else
bytRemLen = Len(tmp)
For cntr = 1 To bytRemLen
strPrevChar = Mid(tmp, Len(tmp) - cntr, 1)
If IsNumeric(strPrevChar) Then
tmpStr = Left(tmp, Len(tmp) - cntr)
GoTo ChkForExistingW
End If
Next cntr
End If
ChkForExistingW:
bytRemLen = Len(tmp) - Len(tmpStr)
strRemStr = Right(tmp, bytRemLen)
bytWLoc = InStr(1, strRemStr, "W")
If bytWLoc > 0 Then
'read the "W" string from the string (no matter
' if it is a capital "W" or not it will still be
' the same character
strW = Mid(strRemStr, bytWLoc, 1)
tmp = tmpStr + strW
Else
tmp = tmpStr
End If
If strHyphen > "" Then
tmp = tmp + strHyphen
End If
End If

ReturnString:
fGetFirstChars_Nums_w = tmp
End Function
'****End of Code****

And, No, I did not write Access, in fact, I am self-taught in using Access.
I have to give a lot of credit to the other folks who consistantly contribute
to these newsgroups. If it had not been for them and all of their help over
the years, I would never have been able to learn what I know about Access. I
learn something everyday.
Your right I posted a message over at Microsoft saying that it did work. I
thought you might see it here also since I seen your reply there.
[quoted text clipped - 26 lines]
 
Haggr,

I am very happy to have been able to help. Many other have helped me and
this is just an opportunity to return the favor.

I must admit that I was wondering what those values were and what they could
represent.

Just for the record, I am a contract developer and I work at this everyday.
As I say, I am continually learning everyday.

Again, glad to help.
--
HTH

Mr B


Haggr via AccessMonster.com said:
You got it. The "Cobol" guys are going to crap. They wanted to help me,
they have that "Root Item Style", but their boss would not allow them to
alter [tabels] and they couldn't figure out how to add that [field] to my
downloadable file (tab-delimited) of all things. You right about one thing,
the people on this and other "Access" sites are totally selfless. Hope you
can help me do some tweaking to this function() "if needed", as the "Cobol"
boys admited, as time went on, they had to get creative to keep adding to
that string. Far as I can see, all "Root Items" are fine. Man if you only
knew how much this helps. Sincerely Thanks.

PS I'm a jewelry manufacturer. All those "aa" "pt" "7.5" refer to the
stones and sizes.
ex (xan72aa-7.5) = Anniversary Ring, AA quality diamonds, size 7.5
or (xmr113/4sy Mothers Ring with 4 stones

And I needed to get to the "root" for billing. Now it is just "scan and
click"

and "W" is White Gold

Thanks again

Mr said:
Haggr,

There was a flaw in the assumptions for Rule A.

I have tested the function below against all of your examples and it returns
values in each case that are equal to your examples.

I have modified the function:

'****Start of Code*****
Public Function fGetFirstChars_Nums_w(pString As Variant) As String
Dim tmp As String
Dim tmpStr As String
Dim strRemStr As String
Dim strNxtChar As String
Dim strPrevChar As String
Dim strW As String
Dim bytChrLoc As Byte
Dim bytWLoc As Byte
Dim bytRemLen As Byte
Dim bytStrLen As Byte
Dim strHyphen As String
Dim cntr
Dim NoNumber As Boolean
Dim NoW As Boolean

'set the values of the flags
NoNumber = False
NoW = False
If Len(Trim(pString & "")) > 0 Then
'rule "B" - if the string contains a "/"
bytChrLoc = InStr(1, pString, "/")
If bytChrLoc > 0 Then
'the following code will loop until the
'previous character is numberic
FindLastNum:
'Character before the "/" must be a number
strPrevChar = Mid(pString, bytChrLoc - 1, 1)
If IsNumeric(strPrevChar) Then
tmp = Left(pString, bytChrLoc - 1)
'next check for any number following the "/"
strRemStr = Right(pString, Len(pString) - bytChrLoc)
bytRemLen = Len(strRemStr)
For cntr = 1 To bytRemLen
strNxtChar = Mid(strRemStr, cntr, 1)
If IsNumeric(strNxtChar) Then
strNxtChar = Mid(strRemStr, cntr, 1)
tmp = tmp + "/" + strNxtChar
GoTo ChkForLetterW
End If
Next cntr
If cntr = bytRemLen + 1 Then
NoNumber = True
End If
ChkForLetterW:
'check to see if the letter "W" exists
'in the remainin g string
bytWLoc = InStr(1, strRemStr, "W")
If bytWLoc > 0 Then
'read the "W" string from the string (no matter
' if it is a capital "W" or not it will still be
' the same character
strW = Mid(strRemStr, bytWLoc, 1)
tmp = tmp + strW
Else
NoW = True
End If
'rule "B-2" - if there is no number following the "/" and
' there is no "W" following the "/"
'use rule "A"
If NoNumber = True And NoW = True Then
GoTo RuleA
End If
'the rules for "B" have been applied and the string is ready
GoTo ReturnString
Else
'try to find the last number in the string
bytChrLoc = bytChrLoc - 1
GoTo FindLastNum
End If
Else
tmp = pString
End If

'rule "C" - if the string contains a "-"
bytChrLoc = InStr(1, tmp, "-")
If bytChrLoc > 0 Then
strHyphen = Right(tmp, Len(tmp) - (bytChrLoc - 1))
tmp = Left(tmp, bytChrLoc - 1)
Else
strHyphen = ""
End If

RuleA:
'rule "A" - String must end with a number except when
' there is a "W" in the string
'find the last numeric value in the string
strPrevChar = Right(tmp, 1)
If IsNumeric(strPrevChar) Then
GoTo ReturnString
Else
bytRemLen = Len(tmp)
For cntr = 1 To bytRemLen
strPrevChar = Mid(tmp, Len(tmp) - cntr, 1)
If IsNumeric(strPrevChar) Then
tmpStr = Left(tmp, Len(tmp) - cntr)
GoTo ChkForExistingW
End If
Next cntr
End If
ChkForExistingW:
bytRemLen = Len(tmp) - Len(tmpStr)
strRemStr = Right(tmp, bytRemLen)
bytWLoc = InStr(1, strRemStr, "W")
If bytWLoc > 0 Then
'read the "W" string from the string (no matter
' if it is a capital "W" or not it will still be
' the same character
strW = Mid(strRemStr, bytWLoc, 1)
tmp = tmpStr + strW
Else
tmp = tmpStr
End If
If strHyphen > "" Then
tmp = tmp + strHyphen
End If
End If

ReturnString:
fGetFirstChars_Nums_w = tmp
End Function
'****End of Code****

And, No, I did not write Access, in fact, I am self-taught in using Access.
I have to give a lot of credit to the other folks who consistantly contribute
to these newsgroups. If it had not been for them and all of their help over
the years, I would never have been able to learn what I know about Access. I
learn something everyday.
Your right I posted a message over at Microsoft saying that it did work. I
thought you might see it here also since I seen your reply there.
[quoted text clipped - 26 lines]
unconcatenated and concatenated string
 
Hope your there Mr.B. At work I downloaded my file, the "tab-delimited" from
the "Cobol" guy, Appened it to my [Style] table. Ran the Function() and it
went fine. At the end for the day I download the "tab-delimited" file, tried
append it to [Style] and got error "Numeric Over Flow"

I kind of know that means data mismatch. I going to try to be as detailed as
possible so maybe you can help.

I have a table [Import] linked to a 'tab'delimited" file "import.txt" That .
txt file shows all current activity. I need to need to keep all activity so I
"append" [Import] to a table [Style]. It in in this table that I run the
Function(). [Style] has one extra field that [Import] call [Style].
[MatchString] where the results of the Function() are stored. Below are the
SQL for the append and the functon.

INSERT INTO style ( Job, [Order], Qty, c, Item, [Size], Avl, Type, Due, Age,
[Req'd], [Curr Routing], Sts, Days, Field17, Field18, Field19,
,
Field21, Field22, Field23, Ordered, Field25 )
SELECT Import.Job, Import.Order, Import.Qty, Import.c, Import.Item, Import.
Size, Import.Avl, Import.Type, Import.Due, Import.Age, Import.[Req'd], Import.
[Curr Routing], Import.Sts, Import.Days, Import.Field17, Import.Field18,
Import.Field19, Import.Left, Import.Field21, Import.Field22, Import.Field23,
Import.Ordered, Import.Field25
FROM Import;


UPDATE Style SET Style.MatchString = fGetFirstChars_Nums_w([item]);



both tables have all the same propertied and the extra [MatchString].[Style]
has the same propertied as [Import].[Item].

I have been using the append query for awhile and it have been okay, even
using other Functions() to store data in [Style].[MatchString]. I just don't
get it. There is not even a field in [Import] to append to [Style].
[MatchString].


Mr said:
Haggr,

I am very happy to have been able to help. Many other have helped me and
this is just an opportunity to return the favor.

I must admit that I was wondering what those values were and what they could
represent.

Just for the record, I am a contract developer and I work at this everyday.
As I say, I am continually learning everyday.

Again, glad to help.
You got it. The "Cobol" guys are going to crap. They wanted to help me,
they have that "Root Item Style", but their boss would not allow them to
[quoted text clipped - 162 lines]
 
Haggr,

Sorry, I have been out all day and just got back in.

I do not see anytihing right off that woud cause any problem.

The code should be stopping when the error occurs. Try to see if you can
capture the screen where the code stops and email it to me at
(e-mail address removed) (just remove the nospamplease).

You might also place your cursor over some of the variables and other items
to determine the current values that they currenly have. Provide me with as
much info as possible and I'll look at it.
--
HTH

Mr B


Haggr via AccessMonster.com said:
Hope your there Mr.B. At work I downloaded my file, the "tab-delimited" from
the "Cobol" guy, Appened it to my [Style] table. Ran the Function() and it
went fine. At the end for the day I download the "tab-delimited" file, tried
append it to [Style] and got error "Numeric Over Flow"

I kind of know that means data mismatch. I going to try to be as detailed as
possible so maybe you can help.

I have a table [Import] linked to a 'tab'delimited" file "import.txt" That .
txt file shows all current activity. I need to need to keep all activity so I
"append" [Import] to a table [Style]. It in in this table that I run the
Function(). [Style] has one extra field that [Import] call [Style].
[MatchString] where the results of the Function() are stored. Below are the
SQL for the append and the functon.

INSERT INTO style ( Job, [Order], Qty, c, Item, [Size], Avl, Type, Due, Age,
[Req'd], [Curr Routing], Sts, Days, Field17, Field18, Field19,
,
Field21, Field22, Field23, Ordered, Field25 )
SELECT Import.Job, Import.Order, Import.Qty, Import.c, Import.Item, Import.
Size, Import.Avl, Import.Type, Import.Due, Import.Age, Import.[Req'd], Import.
[Curr Routing], Import.Sts, Import.Days, Import.Field17, Import.Field18,
Import.Field19, Import.Left, Import.Field21, Import.Field22, Import.Field23,
Import.Ordered, Import.Field25
FROM Import;


UPDATE Style SET Style.MatchString = fGetFirstChars_Nums_w([item]);



both tables have all the same propertied and the extra [MatchString].[Style]
has the same propertied as [Import].[Item].

I have been using the append query for awhile and it have been okay, even
using other Functions() to store data in [Style].[MatchString]. I just don't
get it. There is not even a field in [Import] to append to [Style].
[MatchString].


Mr said:
Haggr,

I am very happy to have been able to help. Many other have helped me and
this is just an opportunity to return the favor.

I must admit that I was wondering what those values were and what they could
represent.

Just for the record, I am a contract developer and I work at this everyday.
As I say, I am continually learning everyday.

Again, glad to help.
You got it. The "Cobol" guys are going to crap. They wanted to help me,
they have that "Root Item Style", but their boss would not allow them to
[quoted text clipped - 162 lines]
unconcatenated and concatenated string
 
The code runs fine, very fine. But the data it puts into [Style].
[MatchString] somehow cause a "Numeric Over Flow" error when I later I try to
append [Style]. What else causes that error "Numeric Over Flow".
Thank for your help

Mr said:
Haggr,

Sorry, I have been out all day and just got back in.

I do not see anytihing right off that woud cause any problem.

The code should be stopping when the error occurs. Try to see if you can
capture the screen where the code stops and email it to me at
(e-mail address removed) (just remove the nospamplease).

You might also place your cursor over some of the variables and other items
to determine the current values that they currenly have. Provide me with as
much info as possible and I'll look at it.
Hope your there Mr.B. At work I downloaded my file, the "tab-delimited" from
the "Cobol" guy, Appened it to my [Style] table. Ran the Function() and it
[quoted text clipped - 48 lines]
 
Normally you would see this if you tried to assign a value to a numeric type
variable that it could not accept.

That is why I wanted you to try to find out where the error is occuring.

Are you saying that the error is not occurring in the function?
--
HTH

Mr B


Haggr via AccessMonster.com said:
The code runs fine, very fine. But the data it puts into [Style].
[MatchString] somehow cause a "Numeric Over Flow" error when I later I try to
append [Style]. What else causes that error "Numeric Over Flow".
Thank for your help

Mr said:
Haggr,

Sorry, I have been out all day and just got back in.

I do not see anytihing right off that woud cause any problem.

The code should be stopping when the error occurs. Try to see if you can
capture the screen where the code stops and email it to me at
(e-mail address removed) (just remove the nospamplease).

You might also place your cursor over some of the variables and other items
to determine the current values that they currenly have. Provide me with as
much info as possible and I'll look at it.
Hope your there Mr.B. At work I downloaded my file, the "tab-delimited" from
the "Cobol" guy, Appened it to my [Style] table. Ran the Function() and it
[quoted text clipped - 48 lines]
unconcatenated and concatenated string
 
Correct not happening in the function, it works great. But after running the
function I cann't append any new records to that table as I could before.

Mr said:
Normally you would see this if you tried to assign a value to a numeric type
variable that it could not accept.

That is why I wanted you to try to find out where the error is occuring.

Are you saying that the error is not occurring in the function?
The code runs fine, very fine. But the data it puts into [Style].
[MatchString] somehow cause a "Numeric Over Flow" error when I later I try to
[quoted text clipped - 19 lines]
 
Are you able to add recrods to the table before running the update with the
function?

I assume that the field you are updating with the function is a text type
field. So, the error you are receiving does not make any sense.

I'm afraid that I do not have any other ideas without actully seeing the
database.

Again, if you would like to send me a copy of it, I will be happy to take a
look at it. I posted my email address in a previous post.
--
HTH

Mr B


Haggr via AccessMonster.com said:
Correct not happening in the function, it works great. But after running the
function I cann't append any new records to that table as I could before.

Mr said:
Normally you would see this if you tried to assign a value to a numeric type
variable that it could not accept.

That is why I wanted you to try to find out where the error is occuring.

Are you saying that the error is not occurring in the function?
The code runs fine, very fine. But the data it puts into [Style].
[MatchString] somehow cause a "Numeric Over Flow" error when I later I try to
[quoted text clipped - 19 lines]
unconcatenated and concatenated string
 
didn''t see the email address. How would it send, it's 256 Mb

Mr said:
Are you able to add recrods to the table before running the update with the
function?

I assume that the field you are updating with the function is a text type
field. So, the error you are receiving does not make any sense.

I'm afraid that I do not have any other ideas without actully seeing the
database.

Again, if you would like to send me a copy of it, I will be happy to take a
look at it. I posted my email address in a previous post.
Correct not happening in the function, it works great. But after running the
function I cann't append any new records to that table as I could before.
[quoted text clipped - 10 lines]
 
Wow, that was larger than I was expecting. Have you compacted it recently?

See if you can reduce the size enough to send it.
--
HTH

Mr B


Haggr via AccessMonster.com said:
didn''t see the email address. How would it send, it's 256 Mb

Mr said:
Are you able to add recrods to the table before running the update with the
function?

I assume that the field you are updating with the function is a text type
field. So, the error you are receiving does not make any sense.

I'm afraid that I do not have any other ideas without actully seeing the
database.

Again, if you would like to send me a copy of it, I will be happy to take a
look at it. I posted my email address in a previous post.
Correct not happening in the function, it works great. But after running the
function I cann't append any new records to that table as I could before.
[quoted text clipped - 10 lines]
unconcatenated and concatenated string
 
Every time I close it. It' s about seven years old. Probably aproaching one
million records, most is an archive
. Alot of backuped tables, like
[Style]. How small do you need it.

Mr said:
Wow, that was larger than I was expecting. Have you compacted it recently?

See if you can reduce the size enough to send it.
didn''t see the email address. How would it send, it's 256 Mb
[quoted text clipped - 14 lines]
 
The smaller the better. All I need is just enough to let me see the error
and try to determine where it is comming from. As you take steps to reduce
the size of it, make sure you can still duplicate the error. Once you have it
down to a size that you can email (most emails will not allow a huge size
attachment) then you can zip it to reduce the size even more.

Once you have reduced all you can,if it is still too large to email, let me
know. I have an FTP site that you can use to uploade to. You will have to
contact me via email because I will not post that site here.

One other thing that you will need to do: document the process to duplicate
the error and send that to me as well.
--
HTH

Mr B


Haggr via AccessMonster.com said:
Every time I close it. It' s about seven years old. Probably aproaching one
million records, most is an archive
. Alot of backuped tables, like
[Style]. How small do you need it.

Mr said:
Wow, that was larger than I was expecting. Have you compacted it recently?

See if you can reduce the size enough to send it.
didn''t see the email address. How would it send, it's 256 Mb
[quoted text clipped - 14 lines]
unconcatenated and concatenated string
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top