April 27, 200421 yr I have a timestamp field that is auto-enter upon the commiting of a record. What i need is a field that returns the previous day of the record. Not 24 hrs. If someone commits it on 4/28/04 at 12:01 AM, then it should say 4/27/04. I looked through the date functions and didnt see anyway to extract the date from a time stamp field so i used: LeftWords ( timestamp ; 1 ) this returned the date of the timestamp value. So, i added a - 1 to the calc. Leftwords(timestamp ; 1) -1 But this gives me a ? in the field. Oddly if i create a two extra fields (three total), i can get it to work: "Timestamp" ; timestamp format ; auto-enters timestamp "ExtractDate" ; Calculation-date format ; Leftwords(timestamp ; 1) "PreviousDate" ; calc.-date format ; ExtractDate - 1 While this will work... why do i have to split the calculation into two fields? In my mind, Leftwords(timestamp ; 1) - 1 should work? that is essentially what i am doing anyway...
April 27, 200421 yr LeftWords() is changing the date portion to be text. Try: GetAsDate( timestamp ) - 1 instead, that should leave the result as type date.
Create an account or sign in to comment