Error using a function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I am running a select query on a table called Order_Details. The query is
very basic with order number, item name, etc. The table encompasses both
checks recorded by an employee on site and e-commerce. With the e-commerce,
often, HTML comes in as part of the Item Name field. So in order to fix
this, I used the following function:

Expr1:
IIf(Left([order_details.item_name],1)="<",Mid([order_details.item_name,24,),[order_details.item_name]))

So in English, if the item name begins with a <, then start from the 24th
character (because that's where the HTML ends) and only display characters
after the 24th character. This query is called OrderDetails.

However, i get a problem because when I run this query i get a message
telling me that my query name is too long or it contains punctuation and does
not work. I do not understand why this happens. If I remove the code and
just display the item name as is, then it works fine. Is the code too
complex? Any ideas?

Thanks a lot,
Rob
 
You are not specifying the length of your Mid Function

Mid([order_details.item_name,24, ##Need a number here## )
 
Thanks for your quick response. I actually read on techonthenet.com (under
access functions) that if you don't put a length, it will just take the rest
of the text. Am I mistaking?

Thanks again.


Darren said:
You are not specifying the length of your Mid Function

Mid([order_details.item_name,24, ##Need a number here## )


Rob said:
Hi all,

I am running a select query on a table called Order_Details. The query is
very basic with order number, item name, etc. The table encompasses both
checks recorded by an employee on site and e-commerce. With the
e-commerce,
often, HTML comes in as part of the Item Name field. So in order to fix
this, I used the following function:

Expr1:
IIf(Left([order_details.item_name],1)="<",Mid([order_details.item_name,24,),[order_details.item_name]))

So in English, if the item name begins with a <, then start from the 24th
character (because that's where the HTML ends) and only display characters
after the 24th character. This query is called OrderDetails.

However, i get a problem because when I run this query i get a message
telling me that my query name is too long or it contains punctuation and
does
not work. I do not understand why this happens. If I remove the code and
just display the item name as is, then it works fine. Is the code too
complex? Any ideas?

Thanks a lot,
Rob
 
Back
Top