A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error when using Left Function



 
 
Thread Tools Display Modes
  #1  
Old January 13th, 2005, 09:55 PM
Melinda
external usenet poster
 
Posts: n/a
Default #Error when using Left Function

Hello,
I am trying to query out all but the last 3 characters of my contract name.
Here's the SQL I'm using:

SELECT Left([Contract],Len([Contract]-3)) AS JobCode
FROM lnkBILLEDBLIINVOICE;

I can't see anything wrong with it, but all I get is #Error in all of my
fields. Any ideas on what I'm missing? I'm using Access 97 on a Windows 98
machine.

Thanks!
Melinda
  #2  
Old January 13th, 2005, 10:11 PM
JL
external usenet poster
 
Posts: n/a
Default

Hi Melinda,

You put the "-3" in the wrong bracket.

Should be,
SELECT Left([Contract],Len([Contract])-3) AS JobCode FROM lnkBILLEDBLIINVOICE;

Hope this will help.


"Melinda" wrote:

Hello,
I am trying to query out all but the last 3 characters of my contract name.
Here's the SQL I'm using:

SELECT Left([Contract],Len([Contract]-3)) AS JobCode
FROM lnkBILLEDBLIINVOICE;

I can't see anything wrong with it, but all I get is #Error in all of my
fields. Any ideas on what I'm missing? I'm using Access 97 on a Windows 98
machine.

Thanks!
Melinda

  #3  
Old January 13th, 2005, 10:41 PM
Melinda
external usenet poster
 
Posts: n/a
Default

Thanks for the correction, but that hasn't helped. I'm still getting the
errors. Any more ideas?

"JL" wrote:

Hi Melinda,

You put the "-3" in the wrong bracket.

Should be,
SELECT Left([Contract],Len([Contract])-3) AS JobCode FROM lnkBILLEDBLIINVOICE;

Hope this will help.


"Melinda" wrote:

Hello,
I am trying to query out all but the last 3 characters of my contract name.
Here's the SQL I'm using:

SELECT Left([Contract],Len([Contract]-3)) AS JobCode
FROM lnkBILLEDBLIINVOICE;

I can't see anything wrong with it, but all I get is #Error in all of my
fields. Any ideas on what I'm missing? I'm using Access 97 on a Windows 98
machine.

Thanks!
Melinda

  #4  
Old January 13th, 2005, 11:11 PM
JL
external usenet poster
 
Posts: n/a
Default

Hi Melinda,

That is interesting. I try my query before I send it.
What do you get when you try the query with the table statement?

SELECT Left([Contract],Len([Contract])-3) AS JobCode;

It will ask you for Contract. Just type "ABCDEFG". The query should return
"ABCD".


"Melinda" wrote:

Thanks for the correction, but that hasn't helped. I'm still getting the
errors. Any more ideas?

"JL" wrote:

Hi Melinda,

You put the "-3" in the wrong bracket.

Should be,
SELECT Left([Contract],Len([Contract])-3) AS JobCode FROM lnkBILLEDBLIINVOICE;

Hope this will help.


"Melinda" wrote:

Hello,
I am trying to query out all but the last 3 characters of my contract name.
Here's the SQL I'm using:

SELECT Left([Contract],Len([Contract]-3)) AS JobCode
FROM lnkBILLEDBLIINVOICE;

I can't see anything wrong with it, but all I get is #Error in all of my
fields. Any ideas on what I'm missing? I'm using Access 97 on a Windows 98
machine.

Thanks!
Melinda

  #5  
Old January 14th, 2005, 01:52 AM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default

Try testing to see if there are at least 4 characters in the contract.

WHERE Len(Contract) 3



JL wrote:

Hi Melinda,

That is interesting. I try my query before I send it.
What do you get when you try the query with the table statement?

SELECT Left([Contract],Len([Contract])-3) AS JobCode;

It will ask you for Contract. Just type "ABCDEFG". The query should return
"ABCD".

"Melinda" wrote:

Thanks for the correction, but that hasn't helped. I'm still getting the
errors. Any more ideas?

"JL" wrote:

Hi Melinda,

You put the "-3" in the wrong bracket.

Should be,
SELECT Left([Contract],Len([Contract])-3) AS JobCode FROM lnkBILLEDBLIINVOICE;

Hope this will help.


"Melinda" wrote:

Hello,
I am trying to query out all but the last 3 characters of my contract name.
Here's the SQL I'm using:

SELECT Left([Contract],Len([Contract]-3)) AS JobCode
FROM lnkBILLEDBLIINVOICE;

I can't see anything wrong with it, but all I get is #Error in all of my
fields. Any ideas on what I'm missing? I'm using Access 97 on a Windows 98
machine.

Thanks!
Melinda

  #6  
Old January 14th, 2005, 02:15 AM
fredg
external usenet poster
 
Posts: n/a
Default

On Thu, 13 Jan 2005 13:41:08 -0800, Melinda wrote:

Thanks for the correction, but that hasn't helped. I'm still getting the
errors. Any more ideas?

"JL" wrote:

Hi Melinda,

You put the "-3" in the wrong bracket.

Should be,
SELECT Left([Contract],Len([Contract])-3) AS JobCode FROM lnkBILLEDBLIINVOICE;

Hope this will help.

"Melinda" wrote:

Hello,
I am trying to query out all but the last 3 characters of my contract name.
Here's the SQL I'm using:

SELECT Left([Contract],Len([Contract]-3)) AS JobCode
FROM lnkBILLEDBLIINVOICE;

I can't see anything wrong with it, but all I get is #Error in all of my
fields. Any ideas on what I'm missing? I'm using Access 97 on a Windows 98
machine.

Thanks!
Melinda


Your PC may have a missing reference.
Open any module in Design view (or click Ctrl + G).
On the Tools menu, click References.
Click to clear the check box for the type library or object library
marked as "Missing:."

An alternative to removing the reference is to restore the referenced
file to the path specified in the References dialog box. If the
referenced file is in a new location, clear the "Missing:" reference
and create a new reference to the file in its new folder.

See Microsoft KnowledgeBase articles:
283115 'ACC2002: References That You Must Set When You Work with
Microsoft Access'
Or for Access 97:
175484 'References to Set When Working With Microsoft Access' for
the correct ones needed,
and
160870 'VBA Functions Break in Database with Missing References' for
how to reset a missing one.

For even more information, see
http://members.rogers.com/douglas.j....nceErrors.html
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #7  
Old January 14th, 2005, 02:15 PM
Melinda
external usenet poster
 
Posts: n/a
Default

Thanks Fred, that solved the problem!

"fredg" wrote:

Your PC may have a missing reference.
Open any module in Design view (or click Ctrl + G).
On the Tools menu, click References.
Click to clear the check box for the type library or object library
marked as "Missing:."

An alternative to removing the reference is to restore the referenced
file to the path specified in the References dialog box. If the
referenced file is in a new location, clear the "Missing:" reference
and create a new reference to the file in its new folder.

See Microsoft KnowledgeBase articles:
283115 'ACC2002: References That You Must Set When You Work with
Microsoft Access'
Or for Access 97:
175484 'References to Set When Working With Microsoft Access' for
the correct ones needed,
and
160870 'VBA Functions Break in Database with Missing References' for
how to reset a missing one.

For even more information, see
http://members.rogers.com/douglas.j....nceErrors.html
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LEFT worksheet function sw Worksheet Functions 2 September 8th, 2004 02:46 PM
Browse Button in Access Spammastergrand Running & Setting Up Queries 6 August 31st, 2004 02:39 AM
Left function dillonke General Discussion 3 August 26th, 2004 07:17 AM
Newbe help - VBA function Kristen Worksheet Functions 2 April 21st, 2004 10:30 PM
Customising the Function Wizard Frank Kabel Worksheet Functions 1 April 20th, 2004 06:46 PM


All times are GMT +1. The time now is 12:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.