LarryLogic Posted June 21, 2004 Posted June 21, 2004 What is the most simple way to extract a date from a number or text field that has the date with the year first? Larry
DanBrill Posted June 21, 2004 Posted June 21, 2004 Datefield contains the data 20040621. Create a calc field with date type as the result: Date(Middle(DateField;5;2);Right(DateField;2);Left(DateField;4)) Dan
-Queue- Posted June 21, 2004 Posted June 21, 2004 Date( Middle( text; 5; 2); Right( text; 2 ); Left( text; 4 ) )
LarryLogic Posted June 21, 2004 Author Posted June 21, 2004 Date() doesn't work. With Middle() & middle()& middle I can dissect it and add it back in month/day/year format. I'm still stumped on how to present a calculation field as a date. I can calculate middle(field,5,2) and get the number of the month. I make another field that uses Monthname(month#field) and the month name doesn't change when I go from one record to the next. What am I missing? Larry
-Queue- Posted June 21, 2004 Posted June 21, 2004 Date does work, actually. Just change the semicolons to commas. I could have sworn your profile stated you were using version 7 at first.
LarryLogic Posted June 21, 2004 Author Posted June 21, 2004 I already tried it with commas with no success. Larry
-Queue- Posted June 21, 2004 Posted June 21, 2004 What's the result you're getting? See attached sample. texttodate.zip
DanBrill Posted June 22, 2004 Posted June 22, 2004 Did you make sure that the calculated result is set to be a date?
LarryLogic Posted June 22, 2004 Author Posted June 22, 2004 I can make the calculated field a date and it doesn't help. I am importing the field that I am trying to use. I can create a field that changes the number so the year is last. It won't display as a date and it won't display anything when I import more data. I don't know what I'm missing. I've done this before with dates with no problem. Is it something to do with when the field gets put in, or storage options? I had similar problems with Record count in file and found record count. I messed with it until it displayed correctly after each change. Larry
-Queue- Posted June 22, 2004 Posted June 22, 2004 Are you importing text or numbers? Is there anything else possibly in the field that could be causing problems, like a space or carriage return, etc.?
LarryLogic Posted June 22, 2004 Author Posted June 22, 2004 I didn't have Perform auto import options checked. It seems to be working now. I knew it was something stupid. Thanks everybody, Larry
Recommended Posts
This topic is 7720 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