D Dave_epic Registered User. Local time Today, 04:01 Joined Mar 6, 2008 Messages 39 Mar 4, 2009 #1 Hi how can I write an update query which adds a '0' to the beginning of a text string in a column only if the text string has 4 characters. If the string is 5 characters I don't want the '0' added. Thanks
Hi how can I write an update query which adds a '0' to the beginning of a text string in a column only if the text string has 4 characters. If the string is 5 characters I don't want the '0' added. Thanks
RuralGuy AWF VIP Local time Yesterday, 21:01 Joined Jul 2, 2005 Messages 13,819 Mar 4, 2009 #2 I would look at the Format() function. Something like: [YourField] = Format([YourField],"00000") ...off the top of my head, which could be all wet.
I would look at the Format() function. Something like: [YourField] = Format([YourField],"00000") ...off the top of my head, which could be all wet.
DCrake Remembered Local time Today, 04:01 Joined Jun 8, 2005 Messages 8,620 Mar 4, 2009 #3 NewValue = Right("00000000" & Cstr([YourField]),5) Where 5 is the number of characters that the new value should be. David
NewValue = Right("00000000" & Cstr([YourField]),5) Where 5 is the number of characters that the new value should be. David
D Dave_epic Registered User. Local time Today, 04:01 Joined Mar 6, 2008 Messages 39 Mar 4, 2009 #4 Thanks format worked great Expr1: Format([Field1],"00000") didn't check the other one yet. Cheers.
RuralGuy AWF VIP Local time Yesterday, 21:01 Joined Jul 2, 2005 Messages 13,819 Mar 4, 2009 #5 Glad we could help.