Monday, March 19, 2012

An if...else task

Hi,

Im running a database query and I want to compare the value of a datetime field to see what I wanna do with my data.

Is there any easy way of doing this with something from the Toolbox or would you recommend using a Script Task?

Thank you.

What do you want to compare it to? Can you give more detail about what it is you are trying to do?

-Jamie

|||

I have 100 rows of query data.

The rows contain a datetime field that I wanna check.

If the row happens before 10 o'clock:

- Do something

After 10 o'clock:

- Do something else

Thank you.

|||All depends on what Something and Something Else is.

You could use a conditional split to send the rows to different places or add an additional column with the flag stating the change or use the script task if you want to change the value of a variable if the condition is found.|||

I would say that conditional split is almost certainly going to be what you are looking for.

in your example you would just set a single case wherein your example datetime column is compared to less than or equal to 10 o'clock and all other rows are sent to default (greater than 10 o'clock) ...

No comments:

Post a Comment