Time Conversion Issue in Linq

Hi…

i have to Substract the start time and end time… fill to Total Hrs…

check the condition if cell empty fill 00.00

Input Data:

image

Expected Ouput:

image

Thanks
Shyam

Hey @Shyam_Pragash

You can use the same logic as we already discussed :slight_smile:

And this looks bit low complex compared to the earlier.

Thanks
#nK

Hi @Nithinkrishna

Is in Time format i try to found total working hrs more than a minute or not…

If((Math.Abs(Convert.ToDateTime(CurrentRow("Total hrs").ToString).Minute)>1),"Less Mins","More Mins")

i am getting error:

Assign: String was not recognized as a valid DateTime.

Thanks
Shyam

Hey @Shyam_Pragash

I can see total hours is a decimal and not a date time, So there is no need for date conversion instead you can do decimal or double conv.

Hope this helps

Thanks
#nK

Hi @Nithinkrishna

All are time format… not Decimal format…

updated snapshot attached.

Thanks
Shyam

Hi @Shyam_Pragash ,

Could you use a Write Line Activity and Print the Value of Total hrs of one row, just to Check the format of the Time value.

Hi @supermanPunch

Total hrs Time format : 5.11.00 AM

Thanks
Shyam

@Shyam_Pragash ,

Could you use the below Expression and Check :

If(TimeSpan.Parse(Split(CurrentRow("Total hrs").ToString)(0).Replace(".",":").Trim).Minutes>1,"Less Mins","More Mins")

Hi @supermanPunch

On you share code…

Expected Output:

image

Input Data:
Book1.xlsx (8.6 KB)

Thank
Shyam

@Shyam_Pragash ,

I am not sure I understand you. Could you explain what was the result that you received when you used the Modified Expression ?

Hi @supermanPunch

Total Hrs is input data to fill into Status
column (done or Not done), if Total Hrs is present & it’s greater or equal to 1 mins write in Done (Status Columns). in case the cell empty or null Write in Not Done in (Staus columns)… All Other empty Cell fill Date time 00:00:00.

i think is it clear for you…

Plz refer Expected Output and Input data Attached in Excel sheet.

Thanks
Shyam

@Shyam_Pragash , When Inspected the Total hrs Column format using a Write Line Activity, the format seems to be the same as that of DateTime.
image

Could you Check the same using a Write Line Activity from your end ? To confirm if that is the case ?

Hi @supermanPunch

My End shows Total Hrs

image

Thanks
Shyam

@Shyam_Pragash ,

Do you have PreserveFormat Checked in Read Range Activity ?

image

Hi @supermanPunch

Updated One

Sharing the Status report.csv file for your reference…

Status Report (2).zip (372 Bytes)

Thanks
Shyam

@Shyam_Pragash ,

For the time being, Just Check if the Below Workflow gets the Output as required :
DT_ConditionUpdate_Rows.zip (10.0 KB)

We can move into different aspects or different data if this works.

Hi @supermanPunch

Thanks You…

But i have many columns… Can you share me on linq

Thanks
Shyam

@Shyam_Pragash , I think we can manage with For Each Row, However we would require to know what are the Columns that need to be Updated.

If it is really required, we could go for a Linq Approach.

Hi @supermanPunch

I think Linq Approach is Best… Because i have many row and columns only daily bases. i have to regenerate it… i want to complete the work easy to fast way…

Thanks
Shyam

@Shyam_Pragash ,

We would still require to know what are the Columns to be Updated and what Columns are to be left as it is.