March 3, 200520 yr Newbies Hi, This is probably a simple one! I have 2 databases each with a field 'dateastext'. One is a global, and one isn't, but they are both Text format fields. In my script, I: Set Field[file1::dateastext;GetAsText ( Get ( CurrentDate ))] which in one file returns: 3/3/04 and in the other returns: 3/03/04 and as a result I cannot link the two files on the date field for a portal lookup! Do you clever chaps (and chappesses) know and way to standardise the return... TIA, Bob
March 3, 200520 yr Have you tried just using Get(CurrentDate)? 7 is smart about converting it naturally.
March 3, 200520 yr Author Newbies Yes, just tried and it didnt work... Is there any locale (regional settings)information that can be modified in the actual database file itself? This is so frustrating! Thanks again, Bob
March 3, 200520 yr I'm not certain what would cause this, but you could always use Right( "0" & Month(Get(CurrentDate)); 2 ) & Right( "0" & Day(Get(CurrentDate)); 2 ) & Year(Get(CurrentDate)) as your calculation.
March 3, 200520 yr You could also try cloning the files, to make sure they inherit the system's format. And/or in File Options.. Text, check Always use current system's settings. But truth to be said, relying on a date to text conversion is always iffy. Why not simply use the date as date, or as a number?
March 3, 200520 yr Building on what Queue said, generally speaking you should make your relationships dependent on a calculation which formats consistently no matter what the system date or other input format is, such as by means of the calculation he includes. You can still use the text date field for other things, but by picking apart and reassembling via calculation the date, you can guarantee the required consistency.
March 4, 200520 yr Author Newbies Thank you all - the Right( "0" & Month(Get(CurrentDate)); 2 ) & Right( "0" & Day(Get(CurrentDate)); 2 ) & Year(Get(CurrentDate)) Code sorted it beautifully. I agree about the comments in using a unique number (but in my case there was a skills shortage in effecting this!) Much happier now.... Thanks again, Bob
Create an account or sign in to comment