kanhaiya80
27th August 2010, 20:02
Hello everybody,

This is my very first post on Baanboard.com.

I am having problem passing date value in Baan session through vb.net.

This does not work:
objBaan.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) &
BaanSession & Chr(34) & "," & Chr(34) & "date.f" & Chr(34) & "," & Chr(34) & "04012008" & Chr(34) & ")")
objBaan.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) &
BaanSession & Chr(34) & "," & Chr(34) & "date.t" & Chr(34) & "," & Chr(34) & "04302008" & Chr(34) & ")")

I tried changing "04012008" and "04302008" to "-878" and "-849" respectively. But that does not work either.

Please help me understand what the problem might be.

Thanks.

mark_h
27th August 2010, 20:22
This is the correct forum for questions like that. I recommend trying to search this forum for posts related to this. It seems I read something once on this topic.

mark_h
27th August 2010, 20:29
See if this thread (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1269&highlight=Date) helps. Seems like there were others, but this was the first I ran into.

kanhaiya80
27th August 2010, 21:22
Mark,
Thank you very much for your reply.

I could not see how the code in the thread you suggested is different than my code.

The way I can enter date value in the actual session is, to be consistent with my post, 05012008 or -878. As soon as the textbox loses focus, the value changes to "05-01-2008". Is this any clue to you to help me answer my question?

Sorry I am completely BAAN illiterate.

Thanks once again, Mark.

mark_h
30th August 2010, 15:44
If you look at you stpapi command you have the date as "04012008". This is a string date. In the code I pointed you to the date is not a string. Use something like this for dates:
date1 = Format("26/03/01", "mmddyyyy")
date2 = Format("26/03/03", "mmddyyyy")

Of course the actual date may vary based off your desktop and what the default date looks like.