Choose Language Hide Translation Bar
Highlighted
wendong
Level I

how to Local data filter with today's date

We are trying to filter the date by today's date.

original line of code is Where( :DateOnly == "2020/02/27" ),

I try to replace the date by Short Date(Today()) or "Short Date(Today())", "|| Short Date(Today())||'  ; nothing worked, anyone can help?

----------

Local Data Filter(
Width( 178 ),
Add Filter(
columns( :DateOnly, :Equipment ),
Where( :DateOnly == "||Short Date(Today())||" ),
Display(
:DateOnly,
Size( 172, 238 ),
Height( 238 )
),
Display(
:Equipment,
Size( 172, 51 ),
Height( 51 ),
"List Display"
)
)
),

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
wendong
Level I

Re: how to Local data filter with today's date

Thanks Jim for saving my day. ( I just need to change your line of code at the end from the semi colon to comma, then it works out)

Where( :DateOnly == format(today(),"y/m/d") ),

 

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: how to Local data filter with today's date

  1. Apparently your :DateOnly column is of data type character.
  2. The function Short Date() returns the format of "mm/dd/yyyy" and you need "yyyy/mm/dd"
  3. The format "y/m/d" will return that value and if you use the Format() function it will return it as the character string you desire
Where( :DateOnly == format(today(),"y/m/d") );
Jim
Highlighted
wendong
Level I

Re: how to Local data filter with today's date

Thanks Jim for saving my day. ( I just need to change your line of code at the end from the semi colon to comma, then it works out)

Where( :DateOnly == format(today(),"y/m/d") ),

 

View solution in original post

Article Labels

    There are no labels assigned to this post.