rlinsurf Posted July 31, 2004 Posted July 31, 2004 Hi-- I have upgraded a database from 6.0 to 7.0 and am having a problem with a date calc field. The calc is supposed to handle a date which is entered in the format: 5/03/03 11:51:24 PM EST And have the result of date: 5/03/03 The calculation is as follows. The first part handles dates which were entered in another format before the present format had started to be used. The second handles the current format: EDITED (sorry about that!): If(MiddleWords(Enter Date;2;1) = "Feb" and GetAsNumber(LeftWords(Enter Date;1)) <= 15 or MiddleWords(Enter Date;2;1) = "Jan"; GetAsDate(If(MiddleWords(Enter Date;4;1) >= 24; Case(MiddleWords(Enter Date;2;1) = "Jan";"1";MiddleWords(Enter Date;2;1) = "Feb"; "2";"3") & "/" & GetAsNumber(LeftWords(Enter Date;1)-1) & "/2002"; Case(MiddleWords(Enter Date;2;1) = "Jan";"1/";MiddleWords(Enter Date;2;1) = "Feb"; "2/";"3/") & LeftWords(Enter Date;1) & "/" & "2002")); Date(LeftWords(Enter Date;1);MiddleWords(Enter Date;2;1);MiddleWords(Enter Date;3;1)+2000) ) This calc worked fine in 6.0, but in 7.0 is coming up as nothing but invalid dates. But the weird thing -- only for *new* entries. All the old records have valid dates in them. As well, I tried entering an old date which is showing a valid result in a previously entered record (the one in the above example) in a new record, it too comes up as invalid. What am I doing wrong?
The Shadow Posted July 31, 2004 Posted July 31, 2004 The word-splitting rules have changed in FM7. In FM6,
Recommended Posts
This topic is 7681 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