cancel
Showing results for 
Search instead for 
Did you mean: 

Null date validation

Former Member
0 Kudos

Hi,

when i am using datefromxmlformat function as below is working fine.

datefromxmlformat(GenericSort_0.Output{/Rowsets/Rowset/Row [#Local.Index#]/TARGETDATE},"MM/dd/yy")

If the variable TARGETDATE has no value, it is terminating the BLT.

Please suggest me.

Thanks,

Vijaya

Edited by: Vijaya Rekha on Jul 4, 2009 8:20 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I am not sure what exactly you are going to do after this.

Please use a conditional action just before that this datetoxmlfformat function used.

Like this.

GenericSort_0.Output{/Rowsets/Rowset/Row[#Local.Index#]/TARGETDATE} != " "

Then if the value is there do what ever you want to do, else in the error loop handle the error.

If you need any other help, expalin the scenario a little bit.

Regards,

kishore

Former Member
0 Kudos

Hi Kishore,

My idea to get the date in dashboard. If the date field has date it is showing in desired date format. For that format I am using datefromxmlformat( datetime, toformat )

Now I am checking if any null date, After that I am applying datefromxmlformat. But i am not getting.

Is there any other way to do that

Thanks,

Vijaya

Former Member
0 Kudos

Hi Vijaya,

I made a slight mistake in the earlier post. Don't check for null date it is not working. I dont know the reason.

GenericSort_0.Output{/Rowsets/Rowset/Row[#Local.Index#]/TARGETDATE} != ""

Remove the space between "". It is working fine for me.

But if you give the space inbetween as like this " ". It does not give the expected result

Hope it solves your problem.

Regards,

Kishore

Former Member
0 Kudos

Hi kishore,

Thanks for your suggession.

I am checking the nulldate like this

stringif(GenericSort_0.Output{/Rowsets/Rowset/Row[#Local.Index#]/TARGETDATE} != "",datefromxmlformat(GenericSort_0.Output{/Rowsets/Rowset/Row[#Local.Index#]/TARGETDATE},"MM/dd/yy"),"")

It is throwing an error.

Thanks,

Vijaya

Former Member
0 Kudos

Hi Vijaya

What error it is throwing?

Instead of

stringif(GenericSort_0.Output{/Rowsets/Rowset/RowLocal.Index#/TARGETDATE} != "",datefromxmlformat(GenericSort_0.Output{/Rowsets/Rowset/RowLocal.Index#/TARGETDATE},"MM/dd/yy"),"")

you try like this:

stringif(GenericSort_0.Output{/Rowsets/Rowset/Row[#Local.Index#]/TARGETDATE} != "",datefromxmlformat(GenericSort_0.Output{/Rowsets/Rowset/Row[#Local.Index#]/TARGETDATE},"MM/dd/yy"),"")

Former Member
0 Kudos

Hi Vijaya

What error it is throwing?sorry,I could not paste the correct format on my last post.

Former Member
0 Kudos

Hi,

The error is like this " Invalid date format in: datefromxmlformat"

Former Member
0 Kudos

Hi,

This happened to me also. To over come this , instead of using it link editor place a if condition above assignment.

In the yes loop you format the date and in the else loop use the null value.

Thats the way you can overcome this problem.

When the value is not there it should go to the esle codition but it validates the yes condition which throws the error.

Hope this solve the problem.

Regards,

Kishore

Former Member
0 Kudos

Hi Vijaya

Is GenericSort_0.Output{/Rowsets/Rowset/RowLocal.Index#/TARGETDATE} returning the date in xml format?

You can put tracer action block and check which format it is coming.

Former Member
0 Kudos

Hi Rekha,

Use like this:

datefromxmlformat(GenericSort_0.Output{/Rowsets/Rowset/Row[#Local.Index#]/TARGETDATE},"MM/dd/yy")

If above code's output is null, then definately it will throw the error,becasue it won't find the date to convert into desired format.

-Suresh

Former Member
0 Kudos

Hi Suresh,

I am using the same format , before that i need to check whether it is null or not. If it is null i need to pass blank over there.

Hi Manisha,

Date from generic sort ---> 2009-06-13T00:00:00.

Thanks,

vijaya

Former Member
0 Kudos

Hi,

Then make the TargetDate datatype as string.If it returns null, then pass the blank value ("").

-Suresh

Former Member
0 Kudos

Hi,

TargetDate is from sqlquerythat format shoud be xmldate format.

Former Member
0 Kudos

I see you are refrencing the xml node via index. Are you sure the xml node always exists?

Former Member
0 Kudos

Wow, what an odd bug. It works fine using

dateformat()

so use that and submit a ticket for the datefromxml issue.

Former Member
0 Kudos

Nice cache christian...

Earlier i too faced these problems. Instead of string i went for if block and seperated the workflow.

But datefromat works fine. I was interested to check this out and it works.

Vijaya,

Hope this problem is solved.

Regards,

Kishore

Former Member
0 Kudos

Hi,

I am using like this

dateformat(GenericSort_0.Output{/Rowsets/Rowset/Row[#Local.Index#]/TARGETDATE},"yyyy-MM-ddTHH:mm:ss","MM/dd/yy")

But now it is displaying all date field is blank.

Former Member
0 Kudos

You need tick marks (') around the string part.

"yyyy-MM-dd'T'HH:mm:ss"

There are some other good date format examples in the MII Help documentation.....