Changing Date Format on-the-fly

lp1972

New Member
Hi everybody,
I'm trying to create a report that takes the date value from a database field and converts it into a new format to be output on a certificate.

I need to pick up the current date in a field e.g. 31/12/2005 (dd/mm/yy) and then convert it to the following format: 2005-12, (i.e. yyyy-mm).

Does anyone know a way that I can do this?

Thank you,
Lee
 
I need to pick up the current date in a field e.g. 31/12/2005 (dd/mm/yy) and then convert it to the following format: 2005-12, (i.e. yyyy-mm).

Use the string, month and year functions. For date_field, try the following:

string (year (date_field),"9999") + "-" + string (month(date_field),"99")
 
That's sorted it !

Thank you so much that is exactly what I was after.
I can now produce a report with the required date format.
Thanks again,
Lee
 
Back
Top