How to remove time from Output

Hi all

Reading the Dates from Excel by using assign activity but getting the out as below shown

How to approach this

image

image

Hi @Sam_H,

You can assign this variable to string. Please use the expression below.

strInvoiceDate = Invoice_Date.ToString(“MM/dd/yyyy”)

Then put strInvoiceDate to Message Box and check it please.

Regards
Ömer

This solution returns “01/20/2020”, “02/03/2022” etc. For dates in format “1/20/2020” or “2/3/2022” the correct expression is:

strInvoiceDate = Invoice_Date.ToString("M/d/yyyy")

@omer.ozturk

when i’m using currentrow getting error

CurrentRow.Invoice_Date.ToString(“MM/dd/yyyy”)

when I’m using currentrow getting error

CurrentRow.Invoice_Date.ToString(“MM/dd/yyyy”)

Hi @Sam_H ,

Could you let us know if you just want to display both the Date values or do you want to add the Date values as well ?

For Displaying, you could check the Below :

Split(Payroll_Date)(0)+" , "+Split(Invoice_Date)(0)

For Adding up dates , Check the below :

CDate(Payroll_Date)+CDate(Invoice_Date)

Check if this works (after assign activity with invoice_date)

Invoice_Date.ToString("MM/dd/yyyy")

Or this:

Cdate(Invoice_Date).ToString("MM/dd/yyyy")

i’m reading Row by row to process something

Hey @Sam_H

Try this, the function is not correctly built:

CDate(CurrentRow(“Invoice_Date”).ToString).ToString(“MM/dd/yyyy”)