Mid-function does not look at length parameter

EsK

Joined
Jul 31, 2009
Messages
1
Reaction score
0
Hello,

I have a query that i originally made using Access 2000.
My problem is that the expression using the Mid function, doesn't use the length value any more as soon as i change something (unrelated) in that query.

The query has only one linked table as source.
One of the fields converts a textfield with a date (e.g. 020109 (second of January 2009)) to the format 02-01-09 through:
Expression: (Left([FieldX5],2)) & "-" & (Mid([FieldX5],3,2)) & "-" & (Right([FieldX5],2)).

This works OK.
But as soon as i want to change something in the query (for instance, add another field of the table), the Mid part from the Expression shows everything from the 3rd character on, as if the length parameter hasn't been specified.
Same happens if i first copy the query and then start working on it.
Same happens in a different query with a different source in the same database.
I've tried converting it to Access 2003 (which i am using now) but same happens.
I've tried with making a new database, with only one table with dates and running the query and same happens, so looks like a local problem.
Length (to verify if Access can correctly see the length of a field) returns the correct amount of characters.

Any help is greatly appreciated.
 

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

Top