Importing Combination Text And Numbers

Oct 13, 2005

I am trying to import a field into a data, which is either a number, a number and text or just text. Within Excel the format has been set to text. The data type for the field in Access has been set to text and yet for those records which are only numbers when imported the record is shown as a number in scientific format. Does anyone have any ideas how I can get the number to be a number in its full format?

View Replies


ADVERTISEMENT

Queries :: Combination Of Letters And Numbers = Data Type Mismatch In Criteria Expression

May 16, 2013

I am working on a fairly ancient manufacturing database that identifies items using a combination of letters and numbers. The usual format is to have a letter (which suggests something about the item type) followed by a sequence of numbers.

I am trying to write a query that looks up all the records beginning with a prefix or arbitrary length, strips away the text, and finds the highest number.

Code:

SELECT Right(LocalID,Len(LocalID) - 1) As IDSuffix
FROM tblItemIDCrossReference
WHERE Left(LocalID,1) = 'T' AND IsNumeric(Right(LocalID,Len(LocalID) - 1)=True)

This query produces the error given in the title of this thread, whilst the following works:

Code:

SELECT Right(LocalID,Len(LocalID) - 1) As IDSuffix
FROM tblItemIDCrossReference
WHERE Left(LocalID,1) = 'T' AND IsNumeric(Right(LocalID,5)=True)

This related query also works and shows a load of -1s and 0s correctly

Code:

SELECT Right(LocalID,Len(LocalID) - 1) As IDSuffix,
IsNumeric(Right(LocalID,Len(LocalID) - 1)=True) As Alias
FROM tblItemIDCrossReference
WHERE Left(LocalID,1) = 'T' AND

But once again shows the error message when I try to filter the field Alias to -1 or 0 only through the right-click menu.I have tried piping Len(LocalID)-1 through CLng, CInt, Int, CDbl and CSng; this changes the error to 'Invalid Use Of Null' I have also tried removing the '=True' from the IsNumeric() term.

View 2 Replies View Related

Importing Negative Numbers

Jan 23, 2008

Good morning,

We have some programmers creating text files from our mainframe. We will then import these text files into Microsoft Access. We have some negative numbers in the text files that the programmers have formatted this way for example, $100.00-. When I import the file into Access, it ignores the negative sign. I told our Lead Analyst that the programmers should format the negative numbers this way, -$100.00 in order for it to import correctly. She doesn't believe me and thinks I'm not importing the file correctly.

Does anyone have an literature on this so that I can show her so that we can move forward? Or can anyone confirm that what I'm saying is correct, it needs to be formatted with the negative sign in front of the number, not behind it.

Thank you

View 1 Replies View Related

Numbers Stored As Text Convert To Numbers?

Jan 10, 2007

Ok so in excel I have some numbers that are stored as text. The reason being that they are zip codes and some begin with 0 and excel doesn't want numbers to start with 0....so when I import these into an access field that has an input mask for zip codes...will it convert these correctly since the field is a text with input mask?

View 1 Replies View Related

Importing ID Numbers To Populate A Textbox

Jun 6, 2007

Dear All:

I have an access database with ID numbers(9-digits), names and a textbox titled "graduated".

I have an external excel file with ID numbers and and a column called Yes/No. Some of the ID numbers are already in the access database.

Can I do an import process and if the ID numbers match, the textbox called "graduated" will automatically populate with the word Yes or No?

Any ideas on how to get going?

Many thanks,

Dee

View 2 Replies View Related

Sorting Text Field Containing Both Text And Numbers Sequentially?

Mar 26, 2014

We have a database that we use to track the tablets in our organization, a combination of Apple, Android, and Windows.

We label them with a hostname depending on their branding. Example below.:

APPLE01
APPLE02
APPLE03

ANDROID01
ANDROID02
ANDROID03

WINDOWS01
WINDOWS02

In the database we use the field name HOSTNAME for these entries. When sorting the field, due to it being a text field, we get the traditional sort of

APPLE01
APPLE02
APPLE10
APPLE100
APPLE101
APPLE11
APPLE110

ANDROID01
ANDROID02
ANDROID10
ANDROID100
ANDROID101
ANDROID11
ANDROID110

We would like to have them show up as

APPLE01
APPLE02
APPLE10
APPLE11
APPLE100
APPLE101
APPLE110
ANDROID01
ANDROID02
ANDROID10
ANDROID11
ANDROID100
ANDROID101
ANDROID110

What is the best way to tackle this?

View 1 Replies View Related

Modules & VBA :: Importing Text Using Text Wizard

Jun 2, 2015

I have a list of 30 files I need to import into my access database. The files in the folder are named

1. Txt
2. Txt
3. Txt
4. Txt
5. Txt
6. Txt
7. Txt
8. Txt

When I did the first import I did it by doing an import text file, located the file 1.txt. The Import Text Wizard opened and I picked Fixed With so I could break out the information myself.After dividing that information I hit advanced and changed the field name to match what they should be. Next, then it ask me to save Import Steps and I said yes.

First: how I can use the saved import to import this file again using the text wizard
Second: how can I set it so it imports a numbers of files, maybe one or maybe all 30?
Third: how difficult would it be to all the file name in the first or last column?

View 2 Replies View Related

How To Have Text And Not Numbers In Text Data Type

Jan 13, 2006

I was wondering if there is a way of only allowing text in a text field - we need to do this for validation purposes when inporting a text file into a database. I have tried input mask but this only checks when entering new data - I have tried to use validation rule like"???????" however this means that there has to be 7 letters in each field and this is not the case. - the field is for town and a couple of the records in this field have numbers at the end which are incorrect that we want the database to reject :eek:

View 1 Replies View Related

Importing Text

Feb 8, 2006

I want to import a text file that is one continuous string at present when i try to import the file it treats the data as one row.

I would like to split so that a new row is created wherever an apostrophe
appears in the string IE (') I can use this as the delimiter when importing as one row, but for some reason it creates errors after field 30

I've included a sample of the data

Cheers

View 1 Replies View Related

Importing Text

Feb 22, 2008

I have a database that a user wanted created. They gave me code used in another database to import the text file automatically using code. I looked at the code but I don't see where the file is coming from. I am not familiar with the transfertext code. I need to import a text file into an access table. The text file needs cleaning up because it comes from another program and it has breaks and the header repeats in the middle of the file several different times. I need code to clean up before it is imported into the table. I can't see how this code works enough to use it:


Code:
Private Sub cmdImport_Click()

Dim mResponse As String
Dim mDir As String
Dim intRecordLength As Integer
Dim strRecord As String
Dim strRecordType As String
Dim strSQL As String

Dim strID As String
Dim strDate As String
Dim strLev As String
Dim strCode As String
Dim strBranch As String

'************** Check for populated stat table
If DCount("[ID]", "tblStats") > 0 Then
MsgBox "Clear previous data before importing a new file.", vbOKOnly, "Clear Data"
Exit Sub
End If
'************** End Check


'************** Get File
mResponse = GetOpenFile_CLT(mDir, "Select file to be imported.")
mResponse = LCase$(mResponse)
If mResponse = "" Then
'If no path specified, abort
MsgBox "No file selected, import cancelled."
Exit Sub

End If
mDir = mResponse
Do While Right$(mDir, 1) <> ""
mDir = Left$(mDir, Len(mDir) - 1)
Loop
'************* End Get File


'************* Set Label/Form
Me.lblProcess.Caption = "Importing " & mResponse
DoCmd.Hourglass False
DoCmd.RepaintObject acForm, "frmImport"
'************* End Label/Form


'************* Start Import
Open mResponse For Input As 1

Do While Not EOF(1)
intRecordLength = 28
Input #1, strRecord

If Len(strRecord) < intRecordLength Then
GoTo sLoop
End If

'If length is 41
If Len(strRecord) > intRecordLength Then
strID = Trim(Left(strRecord, 12))
strDate = Trim(Mid(strRecord, 14, 11))
strLev = Trim(Mid(strRecord, 26, 3))
strCode = Trim(Mid(strRecord, 33, 2))
strBranch = Trim(Mid(strRecord, 40, 2))
End If

'If length is 28
If Len(strRecord) = intRecordLength Then
strDate = Left(strRecord, 11)
strCode = Mid(strRecord, 20, 2)
strBranch = Mid(strRecord, 27, 2)
End If

'Insert into table
strSQL = "INSERT INTO tblStats VALUES ('" & strID & "','" & strDate & "','" & _
strLev & "','" & strCode & "','" & strBranch & "');"
CurrentDb.Execute (strSQL)
sLoop:
Loop
Close 1
'********** End Import


sExit:
'************* Set Label/Form
Me.lblProcess.Caption = "Import Complete " & mResponse
DoCmd.Hourglass False
DoCmd.RepaintObject acForm, "frmImport"
'************* End Label/Form

End Sub

Please help
Thanks

View 5 Replies View Related

Importing Text Files

May 1, 2006

Hi!
I'm trying to import csv files into an Access 97 database, but the filename is different each time otherwise I would just use a commandbutton with the transfertext macro.

I've been searching for help to browse to a file and keep coming back to the same few pages but not being a programmer I can't figure out how to use the code.

Can anyone help me with simple instructions on how to do this?
Thanks.
Anna.:confused:

View 5 Replies View Related

Importing Text File

Aug 7, 2006

We have received a zip file from a new client containing several thousand loans. The problem is that when I open the file as text all of the data is in one "field" meaning instead of going across the data goes down.
loan type,
loan number,
origination date,
loan term,
lo type,
etc....

Then it starts over with the next loan. There are over 17,000 lines.

How can I import the text file and have the loans go across. Even when I have imported the file using comma delimited it still imports them going down. Even if the comma delimited would work, I would still have issues because Access would not know when the new loan began to move it to the next row.

Any thoughts or suggestions? Sorry for my rambling.

View 6 Replies View Related

Importing Text Strings

Jan 14, 2008

hi guys,

i am importing a tab seperated file into a table, and one of the fields is a user comment.

all is well -- until a record is imported that contains comment with a carriage return followed by some more text. the text after the carriage return is imported as the next record.

if the file is tab seperated, why is the carriage return causing the import to act in this way?

thanks

rik.

View 6 Replies View Related

Importing Rich Text

May 23, 2005

I have a .csv (MS Excel) file I need to import, but one of the fields contains rich text format text.

Is there anyway to clean this up before or after it is imported?

Thanks,

T.J.

View 2 Replies View Related

Importing Text File?

May 27, 2005

Hey,

I have a text file i wish to link up to one of my tables. The problem is that even if i try to import data from that file i get "Text file specifikation field separator matches decimal separator or text delimiter." message and after that one an err that the file cant be imported. Does anyone know why?

Thats the sample of my file:
'PV','045.302','KROG VEN S PNEU POG','JOHN-VALVE + AIR TORQUE','JV-9301NC-BW + AT051DA','','','','15','8','VANI','','1.4408','PTF E','ZRK'

View 4 Replies View Related

Importing Text Files

Feb 7, 2008

All,
I have a database that I import text files to create tables. I ve been doing this awhile but now I have to pass it on to someone else to do and are trying to find a better way. this is what I've been doing: I import the text file into a new table. Then I copy and paste the data to the corresponding table. I know I can do an append query to do this but its about 12 text files I have to import into 12 different tables and I didn't want to take the time. I then run a query to combine and sum data from two different tables. The problem is that I have to copy and paste because if I import the text files directly into the corresponding table, the query don't run. I've tried change the field data type in the import wizard but it still doesn't work. My table datatype fields are: field1-text field2-number and field3-number. There is not field for number in the wizard but I use double as a field size in the design table so I select this in the wizard. I don't know how to resolve this other than spending time to create an append query or cut and paste. Please help
Thanks

View 1 Replies View Related

Importing Co-mingled Text

Sep 14, 2005

I have source data that is tab delimited, but the data is interspersed.

<tab>T1F1<tab>T1F2<tab><tab>T1F3<eoln>
T2F1<tab>T2F2<tab>T2F3<tab>T2F4<tab>T2F5<tab>T2F6...<eoln>
T2F1<tab>T2F2<tab>T2F3<tab>T2F4<tab>T2F5<tab>T2F6...<eoln>
<tab>T1F1<tab>T1F2<tab><tab>T1F3<eoln>
T2F1<tab>T2F2<tab>T2F3<tab>T2F4<tab>T2F5<tab>T2F6...<eoln>

That sort of gives a feel for how the data is laid out. T1F1, means the data here goes into the first field of Table1, T2F1 means the data goes in the first field of Table2.

You can tell the difference etween table1 and table2 data because table1 data starts with a tab, and table2 data does not.

Can Access directly import this data?

I haven't found anything that would work, but hey, I am known to overlook the obvious solution, so I hope someone can help.

Thanks,
David

View 5 Replies View Related

Need Help Importing Text File

Oct 26, 2006

Hi! There was a problem that one of the members had a while back, and the solution was never posted. Now, I am having the exact same problem. Here's the link.

http://forums.aspfree.com/microsoft-access-help-18/importing-multiple-text-files-125634.html

When I compile, it works ok, but then when I click my command button, it says I can't import this file. Any ideas?

KellyJo

View 1 Replies View Related

Converting Text To Numbers

Jun 14, 2006

I wondered if someone could help.

I am using the Val () Function to convert a text field to number within a query which still gives me a text output.

P.S I do not have permissions to change within table as using Access as a front end to SQL via link Tables.

View 1 Replies View Related

How To Convert Text To Numbers?

Mar 24, 2007

Hello, I have a Field in a Table called Fund Codes and they are entered as text: 1, 2, 3, 4 all the way to 1000. Now i need to find away to change 1 to 001, 2 to 002, 3 to 003, 10 to 010, but leave 100 as 100 and 222 as 222, so only add 0s to numbers from 1 to 99. Is there a way to do it? I know i can change the text to numbers and use format to do that, but i need to leave it as text. Please help. Many thanks!

View 11 Replies View Related

Treating Text Like Numbers

Oct 12, 2006

HI,
I have a field that contains mainly numbers, but the data type is set to Text because there are a few records where the numbers have a letter suffix.

Eg. Invoice numbers 100, 101, 102, 102A, 103 etc.

These suffixes are a result of poor data entry when the data was stored in Excel.

What I was to be able to do is sort this field and treat all entities as numbers. Currently when I sort it, it shows:

1
10
11
2
20
21
3
...etc

Is this possible, even though the data type is Text?

View 2 Replies View Related

Text + Numbers In 1 Field

Feb 17, 2005

Is it possible to have text and numbers in one field as access asks you specify the data type of that field?

View 1 Replies View Related

Importing Fixed With Text Files

Jun 7, 2005

Dear All,

I need some help. I am writing a database for my new and small company. I receive internet orders from my ISP in an email. I want to find a simple way of automatically importing these emails into my "Customer Information" table.

The issue is that I have no control on the format of the email I receive from my ISP. The data is fixed width and stores the information horizontally rather than in columns. For example:

Quantity : 1
Price : GBP 199.00
Delivery : GBP 5.00
Total : GBP 204.00

I have been exploring the GetData option and using the advance settings to align fields. It seems (and I am not an expert user of Access) that the GetData function relies on the import source to be aligned in vertical columns rather than horizontally. This makes mapping the fields almost impossible.

Does anyone have a clever work-around? Either in Access or manipulating the data before it goes into the database?

Many thanks, Matthew (matthew@byatt.com)

View 4 Replies View Related

Importing Text To Table Problem

Sep 19, 2004

I have a large Microsoft Word document that has a table. My delema is, I want to bring each row of the Word table into records in Access table. The problem is the way the text is formated. This is an example of how each table entry looks like in word:
__________________________________________________ _____________________________
Dogs come when they're called; cats take a message and get back to you.
- - - Mary Bly
__________________________________________________ ______________________________
A cat isn't fussy - just so long as you remember he likes his milk in the shallow, rose-patterned saucer and his fish on the blue plate. From which he will take it, and eat it off the floor.
- - - Arthur Bridges
__________________________________________________ _______________________________


Do you have any idea how I can import this text formated as such into Access?

Thank you in advance - John

View 3 Replies View Related

Importing SAP Text Files And Join Help

May 27, 2005

I imported a table into Access from a SAP generated text file. The integrity of the data is fine after import. I then created a new table from the original that has the exact same amount of records and has the same unique field, which is MATERIAL. The problem I have is when I join the two tables in a query, Access returns approx 140,000 records. I am doing a regular join, what could be the problem? Is it possible the table data types are not formated correctly, b.c I imported them all as text so Access would import all lines.

I look forward to anyone's response.

TIA

Ease

View 1 Replies View Related

Importing Multiple Text Files

Aug 1, 2006

I am trying to import several txt from a directory.

The following code is on a button in a form:

Private Sub ImportData_Click()

Dim myfile
Dim mypath

mypath = "G:FinanceAccountingRoyalty2006exports3rd QTR 06JUL 06 est"
Do
myfile = Dir(mypath & "*.txt")
DoCmd.TransferText acImportFixed, "import_data", "tbl_import_tables", mypath & myfile, False, ""
myfile = Dir
Loop Until myfile = ""

End Sub

The problem is this causes a infinite loop

Can anyone help?? Thanks

PS This code was from previous posting, where the transfer was excel files.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved