Home > FAQ > Database > Creating a date out of a month, day and year

Creating a date out of a month, day and year

QUESTION: I have a date stored as 3 numeric fields in my database. The field "MM" holds the month, "DD" holds the day and "YYYY" holds the year. Can I convert these to a single date in ProVal?

ANSWER: Yes. Use Define Field by Expression to create a new field, e.g. DATE, with the expression:

1/1/1900 #DATEPLUS { [(YYYY-1900)*1y] + [(DD-1)*1d] + [(MM-1)*1m] }