0

I'm trying to bring data from two different columns into one query field. Example: Table1 [Field1] and [Field2]. I don't know if that's possible but in my Query I'm trying to bring the datas from these two Fields and show into one in Query. e.g.

|Table|

|DepartureDate1 | DepartureDate2|

| 15 Nov 2021 | 20 Nov 2021 |

|Query|

|DepartureDate1&2|

15 Nov 2021

20 Nov 2021

Thank you in advance.

Thyreme
  • 17
  • 6
  • Do you just want to concatenate the fields to one?: `SELECT MyField1 & ' ' & MyField2 FROM MyTable` – AHeyne Nov 15 '21 at 13:42

1 Answers1

1

Try using a UNION.

SELECT DepartureDate1 AS [DepartureDate] FROM Table1
UNION
SELECT DepartureDate2 AS [DepartureDate] FROM Table1
Kostas K.
  • 8,293
  • 2
  • 22
  • 28
  • Thank you so much for the idea...I've followed this link and it seems to do the job, I just need some additional tweaks. Thank you. https://www.microsoft.com/en-us/videoplayer/embed/RE1YbYd?pid=ocpVideo1-innerdiv-oneplayer&postJsllMsg=true&maskLevel=20&market=en-us – Thyreme Nov 15 '21 at 15:19
  • Additionally, can you show multi-valued field in a row? e.g. If main table has a column and is Displayed as Combo Box where you can select the data from the drop down menu Sourced from another Table. Now the sql doesn't show informations already stored on the table. I know I had the error message "the multi-valued field cannot be used in a union query" and now it it;s not showing that but instead that column its showing blank. Thank you. – Thyreme Nov 22 '21 at 11:20
  • Not sure how you can do this. Please ask another question and make sure to include the SQL script (otherwise it will be closed). – Kostas K. Nov 22 '21 at 12:12
  • Well I am getting the error message "The multi-valued field '[Table].[FieldName]' cannot be used in a UNION query" when trying to view it in Datasheet View mode. The reason is that that field contains informations that are being used as Combo Box from a Row Source of another Table. I know it's complicated but I thought you guys might know the way around this. Anyways thank you for your time and help. – Thyreme Nov 22 '21 at 15:04