Format a date field in query result

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to format the output of a query that selects a date column so that it
outputs for example as 15 March 2005.

That is, in a query where I SELECT customer_name and date_ordered:

It currently outputs the data as follows

JG Enterprises 28/9/2005
ACME Inc 15/7/2004

However I want it to output as

JG Enterprises 28 September 2005
ACME Inc 15 July 2004

Is there somehing I can do in the QBE Grid or in sql view that can help me?
Assistance greatly appreciated.
 
Dylan said:
Hi,

I want to format the output of a query that selects a date column so
that it outputs for example as 15 March 2005.

That is, in a query where I SELECT customer_name and date_ordered:

It currently outputs the data as follows

JG Enterprises 28/9/2005
ACME Inc 15/7/2004

However I want it to output as

JG Enterprises 28 September 2005
ACME Inc 15 July 2004

Is there somehing I can do in the QBE Grid or in sql view that can
help me? Assistance greatly appreciated.

Format([date_ordered], "dd, mmmm yyyy")

The output from the above will actually be text rather than a date so it will
sort and react to comparisons as a string. You can also set the format property
of the column (and still get a date for output), but that setting will not be
inherited if you export the query or use it in a form/report.
 
Excellent!!! Rick and Van, Thanks very much for your responses.


Van T. Dinh said:
Tiny adjustment per original question:

Format([date_ordered], "dd mmmm yyyy")

--
HTH
Van T. Dinh
MVP (Access)


Rick Brandt said:
Format([date_ordered], "dd, mmmm yyyy")

The output from the above will actually be text rather than a date so it will
sort and react to comparisons as a string. You can also set the format property
of the column (and still get a date for output), but that setting will not be
inherited if you export the query or use it in a form/report.
 
Back
Top