View Single Post
  #2  
Old December 8th, 2009, 06:15 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default date format lost in UNION query

If you want the date formatted in a certain way in a UNION query then you have
two choices (that I can think of).

One:
Use the FORMAT function in the query to force the desired date into a string
that is formatted the way you want.

SELECT Format([TableName].[Eval Date],"mmmm dd") as [Eval Date]
FROM [TableName]
UNION
SELECT Format([OtherTable].[Other Date],"mmmm dd") as [Eval Date]
FROM [OtherTable]

Two:
Use the existing UNION query as the source table in another query. You should
then be able to set the date format for the field in the source table in this
new query.



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Marge wrote:
I've merged the results of 2 queries into a UNION query, however I suspect
that one of the fields [Eval Date] has lost it's date format. The reason I
think so is that the field displays as 1/10/06 instead of January 10 as my
formatting in the design view properties instructs (mmmm d). How can I
resolve this? Thanks for any help you can lend.