It is not 'deleting' records but just not pulling them.
You can not.
Your query says to pull only those records where the part number equals the
srtipped part number. Any record whose part number had any of those
characters would not be pulled.
Maybe this is what you want --
SELECT standards_t3.item_nbr,
Replace(Replace(Replace(Replace(Replace([part_nbr],"-",""),"/",""),"\",""),",",""),".","") AS Part_num, standards_t3.cage,
standards_t3.mfr_desc
FROM standards_t3
WITH OWNERACCESS OPTION;
If not, then what are you trying to accomplish?
DevilDog1978 said:
It is a select query. How do I change it so it does not delete the records?
Here is the SQL for the Query:
SELECT standards_t3.item_nbr, standards_t3.part_nbr, standards_t3.cage,
standards_t3.mfr_desc
FROM standards_t3
WHERE (((standards_t3.part_nbr)=StripString([part_nbr])))
WITH OWNERACCESS OPTION;
And the StripString:
Function StripString(strInput As String) As String
Dim objReg As Object
Set objReg = CreateObject("VBScript.RegExp")
With objReg
.IgnoreCase = True
.Multiline = False
.Global = True
.Pattern = "[^a-z|^0-9]"
StripString = .Replace(strInput, "")
End With
Set objReg = Nothing
End Function
KARL DEWEY said:
Is this in a totals query? Removing these characters from your part number
where you are using Group By will reduce the record count.
:
Replace(Replace(Replace(Replace(Replace([part_nbr],"-",""),"/",""),"\",""),",",""),".","")
I am using this expression and after running a query my records drop from
6618 to 4756. Some of the part numbers have a combination of the above
characters so is this deleting them? I need some type of code or expression
that will leave only alpha-numeric characters in the part_nbr field.