How do I loop through a collection of dates with some null values


Badge +1

Hello:

How do I loop through a collection of dates where some dates have null values..    My goal is to insert all dates in the collection into a database  using execute sql.  But my inserts fails when dates in the list are null

Thanks


2 replies

Badge +7

Hi Femi,

Do you get an error when working with the For Each loop and the collection?  I think the right way would be to get all the values in a collection and then testing them one by one. 

For Each

     Run If a date = Null then

          Set the value for that date to i.e. 1900/01/01

     Write date to the database.

Let me know if this is not working like this for you.

Kind regards,

Francois

Badge +1

Francois :

Am storing the dates from the collection in a date variable, and it does not have an option to check for null    

Reply