Convert String to JDEDate

jdepeople

Active Member
Hi List,
I am trying to import a date from access and convert to JDE Date . Date (Data Dictionary Field - FDAT ) is populated in a custom file through access . The format is "3/7/1999". I tried to use "Convert String to Date " - B0800013 to convert the string to JDE Date and write to a file . This method is only working when the date is like "03/07/1999" . It doesn't work when it is "3/7/1999" .Any suggestions as to how to solve this issue ? Thanks in advance .

OW Xe SP22 Update 7
As400
 
Parse your input date into M, D, and Y.
Either check the length of these, or the values (ie < 10), and append the leading zero.
Restring the appended values.
It's cumbersome, but it does the trick.....

Gene
 
If you look at that bsfn, B0800013, you'll notice the szFormatMask = "OSASE". This is what is driving the MM/DD/YYYY format. You could create a new bsfn that is basically just a copy of this and use the following mask: "MSDSE" for your specific requirement.

I would suggest, however, that you create another input parm to your new bsfn that inputs the format mask...I have never been able to find bsfn's that allow the input of the format mask in their date conversion routines (for either the DeformatDate or FormatDate api's). Whenever I go to a client site, I always write new functions that accept the mask string as input...makes them much more useful.

Just my two cents. Good luck.
 
Hi All,
Thanks for your suggestions . After I saw JMR's suggestion , I used B0800208(Convert String Date to Date Format) and passed "MSDSE" as the parameter for the Format Mask . It worked for me .

JMR: I created a custom BSFN like you said but it was giving me the following error .
"COB0000012 - GetProcAddress failed CPAY.dll function _ConvertStringtoDateCustom Error = 127 "


The above function(B0800208) works fine for me unless there is a reason why I shouldn't be using it .

Thanks again .
 
Back
Top