G
Guest
I am working in Access 2003.
I am working on importing a TEXT file and then cleaning it up prior to
extracting the data.
Throughout the file, I have the following records:
*****(2008) and *****(2616)
where the asterisks are actually spaces. The field that this data is
imported to is defined as a text field with a length of 100.
The VB code I wrote looked like the following:
txtTmpData = " (2008)"
sqlstmt = "DELETE tblDNBRawData.RecNo, tblDNBRawData.txtData,
Len([tblDNBRawData].[txtData]) " _
& "FROM tblDNBRawData " _
& "WHERE [tblDNBRawData].[txtData]= " & txtTmpData & ";"
DB.Execute (sqlstmt)
I performed a debug.print of sqlstmt and it shows:
DELETE tblDNBRawData.RecNo, tblDNBRawData.txtData,
Len([tblDNBRawData].[txtData]) FROM tblDNBRawData WHERE
[tblDNBRawData].[txtData]= (2008);
AS you can see, the spaces are there between equal sign and the '(2008)',
but I also get a data type mismatch error.
Could someone help me in fixing this SQL Delete statement..??
Thanks in advance.
David Ehlert
IT Analyst - Communications
County of Fresno
I am working on importing a TEXT file and then cleaning it up prior to
extracting the data.
Throughout the file, I have the following records:
*****(2008) and *****(2616)
where the asterisks are actually spaces. The field that this data is
imported to is defined as a text field with a length of 100.
The VB code I wrote looked like the following:
txtTmpData = " (2008)"
sqlstmt = "DELETE tblDNBRawData.RecNo, tblDNBRawData.txtData,
Len([tblDNBRawData].[txtData]) " _
& "FROM tblDNBRawData " _
& "WHERE [tblDNBRawData].[txtData]= " & txtTmpData & ";"
DB.Execute (sqlstmt)
I performed a debug.print of sqlstmt and it shows:
DELETE tblDNBRawData.RecNo, tblDNBRawData.txtData,
Len([tblDNBRawData].[txtData]) FROM tblDNBRawData WHERE
[tblDNBRawData].[txtData]= (2008);
AS you can see, the spaces are there between equal sign and the '(2008)',
but I also get a data type mismatch error.
Could someone help me in fixing this SQL Delete statement..??
Thanks in advance.
David Ehlert
IT Analyst - Communications
County of Fresno