aalkemist Posted January 31, 2002 Share Posted January 31, 2002 Greetings -- I'm looking to delete a specific set of charachters from a field in about 2000 records. I've tried writing a script to do this, but can't get it down, can anyone help?? Field is a date field and has "0.00" which I'd like to remove but leave the date before it alone completely, field looks like "01/01/01 0.00" I'm trying the substitute function, but keep getting errors while trying to write it. Any assistance would be a start. Link to comment Share on other sites More sharing options...
Gerd Muller Posted January 31, 2002 Share Posted January 31, 2002 left(datefield, 8) should work, if the months and the days always have leading zeros. Make the datefield as text field first! Gerd [ January 31, 2002: Message edited by: Gerd Muller ] Link to comment Share on other sites More sharing options...
Vaughan Posted January 31, 2002 Share Posted January 31, 2002 It must really a *text* field. Link to comment Share on other sites More sharing options...
aalkemist Posted January 31, 2002 Author Share Posted January 31, 2002 unfortunately the date format varies, would there be an easy to account for this??? something like: if char 8 = 2 then Left(datefield,8) else :?? Link to comment Share on other sites More sharing options...
Gerd Muller Posted January 31, 2002 Share Posted January 31, 2002 LeftWords(datefield, 1). As said: datefield has to be a *text* field. Gerd Link to comment Share on other sites More sharing options...
Vaughan Posted February 1, 2002 Share Posted February 1, 2002 Sorry what I meant to say above was this: You have used a text field to store date information, that's why you are having so much trouble. Always store date information in date fields because FMP (and you) can work with it so much easier. Link to comment Share on other sites More sharing options...
Korky Posted February 5, 2002 Share Posted February 5, 2002 If the field is a text field and the date portion is always followed by 'space plus 0.00', the following should work for different lengths of the date portion; Left (Datefield ,Length (Datefield-5)) Link to comment Share on other sites More sharing options...
The Bridge Posted February 5, 2002 Share Posted February 5, 2002 quote: Originally posted by Korky: If the field is a text field and the date portion is always followed by 'space plus 0.00', the following should work for different lengths of the date portion; Left (Datefield ,Length (Datefield-5)) ...or use Substitute(Datefield, " 0.00", "") Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 8108 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now