Understand date format required in a sql statement (II)

Browsing through the Global class, I just recalled the conversion function that can be used to insert data values in the SQL statements.

The function is: date2StrXpp.

/*
    Returns a date as a string in the x++ code format, also used in formulas in queries:
    dd\mm\yyyy
*/
static str 10 date2StrXpp(date _date)
{
//    return strReplace(date2str(_date,123,2,4,2,4,4),'/','\\');
    return num2Str0(dayOfMth(_date),2)+
           '\\'+
           num2Str0(mthOfYr(_date),2)+
          '\\'+
           num2Str0(year(_date),4);
}

No comments:

Post a Comment