Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To avoid altering the format of a field in a union query in Access, you can use the CAST function to convert the data type of the field to the desired format.

For example, if you have two tables with a "Date" field, where one table stores dates as text in the format "mm/dd/yyyy" and the other as actual dates, you can use the following union query to combine the data without altering the format:

SELECT Date FROM Table1 UNION ALL SELECT CAST(Date AS TEXT) FROM Table2

In this example, the second select statement converts the date field from Table2 to text using the CAST function, and preserves the original format.