Datatable convert object to date time field

the data from the csv i am using to generate the data table is in my opening post

one last question - can this be set as variable as i will be using this in a few different places, i f so what type of variable would it be

thanks

@adrian_sullivan ,

Could you let us know what are you referring to here ? Is it the whole Expression or date values ?

sure - currently this is what i have

image

so i what i would like is a variable which i can set to
DTData.AsEnumerable.Where(Function(x) CDate(x(“NewDate”).ToString).Date >= (new DateTime(2022,9,01)).Date andAlso CDate(x(“NewDate”).ToString).Date <= (new DateTime(2022,9,20)).Date).CopyToDatatable

i will be running the same linq query for different environments, so rather than changing the query 3 times i would like to change it just once

thanks

@adrian_sullivan ,

As this is not directly related to the original topic of this post, and I’m assuming the discussion for this would be better elaborated further on a new Topic.

You could create a new Topic for this discussion as you could attain a view of different people on this new case.

To be short, what we normally do is understand the Requirement (Input/Output), We prepare the Linq Query/Logic, In order for us to reuse the same query, we create a separate workflow with configurable arguments (Column Names, Date values, Output Datatable). In this way, the workflow is used whenever a similar requirement is found for other data.

If the above doesn’t answer to your question, I suggest you to create a separate topic.

thanks - i will work with that and see how i get on

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.