Hi Jan,
A date is a number. The date represents the number of days since March 1, 1900. So you can treat it directly like a number. Like a number you can treat it for existence eg [PxFy > 0] , or you can use it for date calculations for say the calculation of days between dates eg today - PxFy, or to work out when a bill must be paid eg PxFy + 30 (or work out from which day to leave your phone off the hook depending on your post GFC financial condition). You can also use a number as an iteration control in a report eg Stop Subreport if RV is False. (False indicating either 1st March 1900, or an empty field (DP does not understand empty number fields but interprets them as a 0) You can apply any mathematical or logical operation directly to a date, but of course some calculations would have little meaning for example PxFy * 2, would have few uses. (and also would be subject to the infamous Y2.079k bug, see below). For use in a formula you do not need to first convert it to a number. If you wish to see a date as a number then you can print the field but instead of accepting its default output format of for example D99/99/9999 view it with the format: NZZZZ9. DP has an inbuilt Armageddon day, on the 31st December 2078, and then becomes subject to its own Y2.079k bug, after which you will have to abandon DP, so enjoy it for the next 25000 days or so; for the end of the world is nigh If you wish to convert a date to a string you can you use the apply.format function which converts a number to text. So to see an Australian date as text I you could use apply.format["DDMY99/99/9999";PxFy]. Regards Brian _____ From: [email protected] [mailto:[email protected]] On Behalf Of J. Hartman Sent: Sunday, 22 November 2009 12:24 AM To: [email protected] Subject: [Dataperf] date conversion Dear All, How do I convert a date D99-99-9999 to a number N99999999 in a formula or vice versa? e.i. 01-02-2009 to 20090201 or 20090201 to 01-02-2009. Thanks in advance! Jan Hartman
_______________________________________________ Dataperf mailing list [email protected] http://lists.dataperfect.nl/mailman/listinfo/dataperf
