Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Len() and Left()

Status
Not open for further replies.

Rick4077

Technical User
Oct 19, 2004
149
US
If Left([FieldName) has no length, ie. 6, will it return the entire value of the field? . . . as a sting?

If Len() contains 23 chr will it return 23?

Thanks . . . Rick
 
Left([FieldName)" won't work for a couple reasons:
[li]There are unbalanced []s[/li]
[li]Left() requires two arguements, not one[/li]
Why don't you try these expressions? Open the immediate window (Press Ctrl+G) and enter:
Code:
? Left("any expression",3)
? Len("any expression")


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Will Left() work with Len() as a wildcard?

This code does not produce the correct results. I suspect it has something to do with the way Left() and Len() are reading the value of the fields.

Code:
Sum(IIf(Left(S.ListName,Len(C.OfcName))<>Left(S.SellName,Len(C.OfcName)),1,0)) AS TSO, Sum(IIf(Left(S.ListName,Len(C.OfcName))<>Left(S.SellName,Len(C.OfcName)),S.SalePrice,0)) AS TSODV,


Thanks much.

Rick
 
It would help if you provided some sample data and the results. I don't necessarily see anything wrong with the expressions. You might also explain what/why you are doing.

We can't see your data or your results or why you think "code does not produce the correct results".

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top