drifter
14th July 2004, 11:42
Hi all
does baan have a function that converts a long (for example 7) in a corresponding month name (to continue the example 7 => Juli).
I know I cane easily make a function to do that but if baan has it then I'd rather use that :)
thanks
Gert Verheyen
14th July 2004, 12:23
Hi,
have you looked at the function sprintf$ for parameters.
There are specific parameters for Date fields. for example:
sprintf$("%D002", tdsls045.ddat) where date format 002 must define how the date should look like.
drifter
14th July 2004, 13:22
Well I tried but the problem is that I don't have a complete date, I only have one number for 1 to 12 (that represents months) and that number I have to convert to a month name if possible using baan built in functions and not my own function.
klixy23
14th July 2004, 15:02
Try this little test program:
#pragma used dll "ottstpstandard"
#pragma used dll "ottdllinputstr"
long month
string month.str(2)
function main()
{
if input.string("Test", "Month number", 2,2, month.str) then
month = lval(month.str)
if (month > 0) and (month < 13) then
message(sprintf$("%D(%H)", date.to.num(2004, month, 1)))
endif
endif
}