yafreax Posted April 27, 2004 Share Posted April 27, 2004 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... Link to comment Share on other sites More sharing options...
The Shadow Posted April 27, 2004 Share Posted April 27, 2004 LeftWords() is changing the date portion to be text. Try: GetAsDate( timestamp ) - 1 instead, that should leave the result as type date. Link to comment Share on other sites More sharing options...
yafreax Posted April 28, 2004 Author Share Posted April 28, 2004 thank you very much, that works exactly how i need it to. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7296 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