tags:

views:

1245

answers:

3

I have two tables with date fields. Each table displays the date in Short Date format (MM/DD/YYYY).

I wrote a Union Query to combine these tables, but the Union query displays the date in General Date (long) format (MM/DD/YYYY HH:MM:SS). I would be grateful for a solution to getting dates out of the Union Query in Short Date format.

+1  A: 

If you are using a querydef, you can right-click on the column in Design Mode and you will find a Format property.

le dorfier
The Access does not support editing UNION queries except in SQL view. You could accomplish what you say if you create another query that uses the saved UNION querydef as the source "table".
David-W-Fenton
+6  A: 

do a select on the union and format the date column at the end:

select format(foo, "short date")
from (
    blah
union
    blah
)
CodeSlave
This will work only if you've got Access set to use SQL92 mode. For regular Jet SQL, you'd need the [SQL statement]. As TableName format for the derived table (not parens).
David-W-Fenton
BTW, with the appropriate syntax, your solution does work.
David-W-Fenton
+2  A: 

There's a nice built in Jet function you can use:

Select Format(myDate, 'mm/dd/yyyy') From Table

Hope this helps!

keith