Choose Language Hide Translation Bar
JulieSAppel
Level IV

Is a date from column contained in date and time column?

Hi,

I´m trying to figure out if a date (from a column with ddMonyyy format) is contained in a date & time column (ddMonyyyy:h:m:s) and create a new column stating whether it is true or not.

I was trying:

If( Char( :Date ) == Substr( Char( :StartTime ), 1, 9 ),
	1,
	0
);

But that didn´t work.

I know I can convert the date and datetime column to strings in new columns and do the comparison but is it possible without doing that?  

Br Julie

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Is a date from column contained in date and time column?

Hi,

 

Pease see if this works for you:

If( Abbrev Date( :StartTime ) == Abbrev Date( :Date ),
	1,
	0
)

View solution in original post

3 REPLIES 3
Highlighted

Re: Is a date from column contained in date and time column?

Hi,

 

Pease see if this works for you:

If( Abbrev Date( :StartTime ) == Abbrev Date( :Date ),
	1,
	0
)

View solution in original post

Highlighted
JulieSAppel
Level IV

Re: Is a date from column contained in date and time column?

Thanks - worked like a charm 

Highlighted

Re: Is a date from column contained in date and time column?

Revised: Ha! I did not understand your problem, so please disregard my 'solution.'

 

I understand your problem as you want to know if the value in :Date is only a date with no time, too. That is, as JMP represents date and time, it is midnight on the given date. You can check that the residual seconds is zero.

 

Not( Modulo( :Date, In Days( 1 ) ) )

 

Learn it once, use it forever!