A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

date format lost in UNION query



 
 
Thread Tools Display Modes
  #1  
Old December 8th, 2009, 04:41 PM posted to microsoft.public.access.queries
Marge
external usenet poster
 
Posts: 84
Default date format lost in UNION query

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.
Ads
  #2  
Old December 8th, 2009, 05: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.

  #3  
Old December 8th, 2009, 05:26 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default date format lost in UNION query

instead of January 10 as my formatting in the design view properties
instructs (mmmm d).
Design view of what?
Are you not taking the data to a form or report? Format there.

--
Build a little, test a little.


"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.

  #4  
Old December 8th, 2009, 07:08 PM posted to microsoft.public.access.queries
Marge
external usenet poster
 
Posts: 84
Default date format lost in UNION query

The design view property for [Eval Date] of each of the queries used to
create the union query is set to format mmmm d. I am not taking the date to
a form or a report; I am creating a make table to add to another query which
will convert to Excel.

"KARL DEWEY" wrote:

instead of January 10 as my formatting in the design view properties

instructs (mmmm d).
Design view of what?
Are you not taking the data to a form or report? Format there.

--
Build a little, test a little.


"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.

  #5  
Old December 8th, 2009, 08:10 PM posted to microsoft.public.access.queries
Dale Fye
external usenet poster
 
Posts: 2,651
Default date format lost in UNION query

instead of setting the "format" property of the field in the queries, you
will need to "format" the field directly. Something like:

Select Format([Eval Date], "mmmm d") as EvalDate
FROM yourTable

and will have to do this for both parts of the union query. This will
obviously change this value from a date to a string.

----
HTH
Dale



"Marge" wrote:

The design view property for [Eval Date] of each of the queries used to
create the union query is set to format mmmm d. I am not taking the date to
a form or a report; I am creating a make table to add to another query which
will convert to Excel.

"KARL DEWEY" wrote:

instead of January 10 as my formatting in the design view properties

instructs (mmmm d).
Design view of what?
Are you not taking the data to a form or report? Format there.

--
Build a little, test a little.


"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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 OfficeFrustration.
The comments are property of their posters.