Friday, March 23, 2012

RIGHT function in a view

Hiya folks,

Having a problem with a view.

I'm using the syntax

Right('000' & Myfield,3) to 'pad' out the results.

ie if MyField contained 45 the answer should be : 045

but i'm getting the results of : 0

Stuck!! Any offers kind people??What's the value of myField? In what type of var is the result stored?|||Its not being stored in a variable, just in the results pane of the View|||How about...

Right('000', 3 - Len(MyField)) & MyField|||Assuming that MyField is a VARCHAR, I'd be inclined to use:Right('000' + MyField, 3)-PatP

No comments:

Post a Comment