cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

How to get date yesterday?

UserID16644
Level V

I would want to get the date yesterday, I am using the today () function

dateNow = Format (Today(), "m/d/y");

However, I don't know how to derive from dateNow the date yesterday. Tried using d = (dateNow - 1);

but is not working.

2 REPLIES 2
hcarr01
Level VI

Re: How to get date yesterday?

In your data table, you can create a new column for example "date yesterday".

 

dt=current data table();// Nouvelle colonne : date hier
dt << New Column( "date hier",
 Numeric,
 "Continuous",
 Format( "Best", 12 ),
);

and then you can write this formula with the date you want to get.

 

// Modifier la formule de colonne : date hier
dt:date hier << Set Formula( Date MDY( 7, 25, 2023 ) );

output you get this:

 

undefined

 

This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .

jthi
Super User


Re: How to get date yesterday?

You will have to deduct the seconds in one day from Today(), using In Days(1) is one option (you could also use 24*60*60)

Today() - In Days(1)

Datetime values are handled internally as numbers of seconds since midnight, January 1, 1904 (JSL Syntax Reference > JSL Functions, Operators, and Messages > Date and Time Functions )

-Jarmo