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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|