Jump to content
Sign in to follow this  
yafreax

time stamp confusion

Recommended Posts

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...

Share this post


Link to post
Share on other sites

LeftWords() is changing the date portion to be text.

Try:

GetAsDate( timestamp ) - 1

instead, that should leave the result as type date.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.