Hii Guys, can anyone help me how can i filter Date only from date and time in reports

Naresh307Naresh307 Member Posts: 2
Thank you

Best Answer

  • DenSterDenSter Member Posts: 8,307
    edited 2021-09-02 Answer ✓
    The DT2Date function expects a DateTime value as input. The Depreciation Starting Date field is not a DateTime field, it is a Date field.
    qdsr3qlmubdv.png

    To see the definition of the field you are working with, you can either hover your mouse over it and it will show up in the tooltip, or you can put your cursor in the field and hit F12, which will open the source object

Answers

  • SanderDkSanderDk Member Posts: 502
    Please elaborate with what kinda of date (Add some code),or else you won't get any good answer
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
  • julkifli33julkifli33 Member Posts: 1,092
    edited 2021-09-01
    you can try
    Setfilter("Your Date",'%1..%2',StartDate,EndDate);
    
  • Naresh307Naresh307 Member Posts: 2
    date := DT2DATE("FA Depreciation Book"."Depreciation Starting Date");
    im trying to write above code to extract date from date and time variable i.e Depreciation Start Date
    here date is a local variable of type Date and FA Depreciation Book is the table.
    but im getting fallowing error

    sariby9p81kr.png
  • jordi79jordi79 Member Posts: 275
    edited 2021-09-02
    Hi,
    Just use EVALUATE(). And only if this does not work, then you do text manipulation.

    Sample code...

    DTVar is a datetime variable
    DateVar is a date variable
    DTvar := CURRENTDATETIME;
    MESSAGE('Before...' + FORMAT(DTvar));
    
    EVALUATE(DateVar, FORMAT(DTvar));
    
    MESSAGE('After...' + FORMAT(DateVar));
    
  • DenSterDenSter Member Posts: 8,307
    edited 2021-09-02 Answer ✓
    The DT2Date function expects a DateTime value as input. The Depreciation Starting Date field is not a DateTime field, it is a Date field.
    qdsr3qlmubdv.png

    To see the definition of the field you are working with, you can either hover your mouse over it and it will show up in the tooltip, or you can put your cursor in the field and hit F12, which will open the source object
Sign In or Register to comment.