thenoisydrum
Registered User.
- Local time
- Today, 04:06
- Joined
- Jul 26, 2012
- Messages
- 52
Ok, this is driving me absolutely mad.
Background is that I am importing a text file invoice into my database.
The table that I import the text file to is deleted before the import takes place. The table has a field called Auto (Autonumber data type) which is sorted into ascending order.
This keeps my invoice in "order" - as it looks in the text file.
I am importing around 19 of this invoices a day and the glitch appears to me to be random.
Here is a screen dump of the first few records from the table (sensitive data scribbled out)

I want to extract the word INVOICE so use the following bit of code;
SELECT First(Trim(Left([All_Data],(InStr(1,[All_Data],":"))-1))) AS [Document Type]
FROM [250-005-Invoice_10];
At this stage I get the error message "Invalid Procedure Call"
To investigate further I decided to trim (scuse the punn) the formula down and use;
SELECT First([All_Data]) AS [Document Type]
FROM [250-005-Invoice_10];
...simply to find out what it regards as the "first" record.
This extracts the data contained from record 1,042 - which contains no ":" characters and hence why I get the "Invalid Procedure Call".
Even if I put a query in between that sorts the Auto column into ascending order it still refers to record 1,042 as being the first!
Why o why o why?
Can anybody please help?
Thanks
'drum
Background is that I am importing a text file invoice into my database.
The table that I import the text file to is deleted before the import takes place. The table has a field called Auto (Autonumber data type) which is sorted into ascending order.
This keeps my invoice in "order" - as it looks in the text file.
I am importing around 19 of this invoices a day and the glitch appears to me to be random.
Here is a screen dump of the first few records from the table (sensitive data scribbled out)

I want to extract the word INVOICE so use the following bit of code;
SELECT First(Trim(Left([All_Data],(InStr(1,[All_Data],":"))-1))) AS [Document Type]
FROM [250-005-Invoice_10];
At this stage I get the error message "Invalid Procedure Call"
To investigate further I decided to trim (scuse the punn) the formula down and use;
SELECT First([All_Data]) AS [Document Type]
FROM [250-005-Invoice_10];
...simply to find out what it regards as the "first" record.
This extracts the data contained from record 1,042 - which contains no ":" characters and hence why I get the "Invalid Procedure Call".
Even if I put a query in between that sorts the Auto column into ascending order it still refers to record 1,042 as being the first!
Why o why o why?
Can anybody please help?
Thanks
'drum