Erikj Posted July 9, 2004 Posted July 9, 2004 This is my situation at the present moment. In my database I have a single date field that reads as such 7/09/2004, then I have three new date fields, one for the month, day, and year. I need to convert the information in the old date field, into the three new date fields for 16,000 records. Any info would be greatly appreciated!
spb Posted July 9, 2004 Posted July 9, 2004 Are your three new date fields defined as true date fields? Or are they number or text fields? Is the original single date field defined as a true date field? In general, assuming this is a one-time data fix, I would run three replace-with-calculations on your three target fields. Each one would have a calculation that specified exactly which part of the data in the originating field is to be replaced into the target field. For example, the calculation for the year would be: Right(OriginalDateField, 4) Picking out the month and day depends on how the fields are defined, as per my opening questions. Warning: Back up data first, and experiment on a clone with a couple dozen records. The replace function cannot be undone. Steved Brown
Erikj Posted July 9, 2004 Author Posted July 9, 2004 The three new date fields are defined as text, and the original single date field is defined as true date field.
spb Posted July 10, 2004 Posted July 10, 2004 Use The Shadow's functions, embedded in a DateToText function to replace the info into your text fields (you may not need this, but it couldn't hurt): DateToText(Month(dateField)), etc. Steve Brown
bruceR Posted July 10, 2004 Posted July 10, 2004 What are you going to DO with these fields? If it's just for display purposes, you don't need to do any of this. You can just take the data field, copy it 3 times across your layout, and set the date options to display just what you asked for with the format:date format: custom option.
Recommended Posts
This topic is 7444 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