|
-
July 30th, 1999, 02:00 PM
#1
Text-Manipul. in Access
My problem is cutting off two characters from the left side in a MS Access-Query. I know that there are bulid-in functions in the expression builder, but I don't know which fits and how I can get my column data in there.
Thanks for helping.
-
July 30th, 1999, 08:07 PM
#2
Re: Text-Manipul. in Access
Here is the code you could insert in your query, assuming that a two (or less) characters long string
would be completely cut off. Maybe there's a more simple way to do it, but this example should work.
croppedstr: Iif(Len(str) < 2, Null, Right(str, Len(str) - 2))
-
August 2nd, 1999, 12:02 PM
#3
Re: Text-Manipul. in Access
Thank you very much! I have further problems implementing this, because
I'am real beginner in VB. Could you help me again declaring the variables in access so that I can use it in a query or should I write a module?
I assume your formula cuts-off the two last characters, is this right? If I want
the first two I have to use left() I suppose.
Thanks in advance.
-
August 12th, 1999, 07:02 PM
#4
Re: Text-Manipul. in Access
Well, this function should cut off the first two characters, did you try it?
You can use a VB variable in a query, for that purpose you should create a function that returns this
variable everytime it's called, i.e. :
'--------------------------------------
' module1
Global Variable as <type>
'
' module2
' [...]
Variable = <value>
' [...]
'
' module3
Function GetVariable() as <type>
GetVariable = Variable
End Function
'---------------------------------------
You can use this GetVariable() function in all your queries (don't forget the parenthesis) just like a built-in
Access function. Note that the VB declarations could be part of the same module.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|