Expr1: Format("012P","0000") Why I get "0001"

amolin

Registered User.
Local time
Today, 08:39
Joined
Apr 29, 2004
Messages
35
Hi, Anyone know? when I use this function in Access Query design grid, we get wrong result?

Expr1: Format("012P","0000") Why I get "0001" thank you ! My Access Version is Access 2007.
 
Last edited:
Expr1: Format("012P","0000") , this expression should get "012P", I think this is a Access 2007 Bug,

Expr1: Format("011P","0000"), we also get wrong result ....
 
Last edited:
It isn't a bug. You just need to understand the function better.
http://msdn.microsoft.com/en-us/library/office/gg251755.aspx

"0000" is a number format. Its results are not defined for a string input and it generally passes the string straight through.

However it gets really confused if confronted with something it can see meaning in. The "P" is causing Format() to see the value as a Time (PM). You will get the same result when you include an "A" instead.

You need to tell us what you are trying to do. Post some examples of the input and what you want them to look like after being processed.
 
There are other functions as well such Left, right, trim, INStr, Trim and many other, first tell what you want to extract.
 

Users who are viewing this thread

Back
Top Bottom