M
Mike Hill
I am trying to extract data from a SharePoint list that are of type
multivalue. I am able to extract the data correctly from a single column
using [Column].Value in my select statement. However, I have 32 multi-value
columns in the table that need to each be converted into a single results
column, I am trying to normalize the multivalue tables into a more usable
structure. I have created a UNION query that works with two of the columns
but as soon as I add a third column I receive an error message, "the number
of columns in the two selected tables or queries of a union query do not
match." My example would look like this:
SharePoint List A:
SharePointMVField1
SharePointMVField2
SharePointMVField3
Access SQL:
SELECT SharePointMVField1.value AS MyColumnName
FROM [SharePoint List A]
WHERE SharePointMVField1.value IS NOT NULL
UNION
SELECT SharePointMVField2.value AS MyColumnName
FROM [SharePoint List A]
WHERE SharePointMVField2.value IS NOT NULL
UNION
SELECT SharePointMVField3.value AS MyColumnName
FROM [SharePoint List A]
WHERE SharePointMVField3.value IS NOT NULL;
I am able to create the query with a single UNION statement but no more than
that. I can create two queries each with as single UNION statement and with
the third query to UNION the results of the first two queries no issues. I
have even tried using the following with no results:
SELECT IIF(IsNull(SharePointMVField3.value),"",SharePointMVField3.value) AS
MyColumnName
This seems like a limitation of the built-in multivalue capability of Access
2007 but wanted to see if anyone had any other thoughts. I guess that I
could write VBA but was hoping for an easier out.
multivalue. I am able to extract the data correctly from a single column
using [Column].Value in my select statement. However, I have 32 multi-value
columns in the table that need to each be converted into a single results
column, I am trying to normalize the multivalue tables into a more usable
structure. I have created a UNION query that works with two of the columns
but as soon as I add a third column I receive an error message, "the number
of columns in the two selected tables or queries of a union query do not
match." My example would look like this:
SharePoint List A:
SharePointMVField1
SharePointMVField2
SharePointMVField3
Access SQL:
SELECT SharePointMVField1.value AS MyColumnName
FROM [SharePoint List A]
WHERE SharePointMVField1.value IS NOT NULL
UNION
SELECT SharePointMVField2.value AS MyColumnName
FROM [SharePoint List A]
WHERE SharePointMVField2.value IS NOT NULL
UNION
SELECT SharePointMVField3.value AS MyColumnName
FROM [SharePoint List A]
WHERE SharePointMVField3.value IS NOT NULL;
I am able to create the query with a single UNION statement but no more than
that. I can create two queries each with as single UNION statement and with
the third query to UNION the results of the first two queries no issues. I
have even tried using the following with no results:
SELECT IIF(IsNull(SharePointMVField3.value),"",SharePointMVField3.value) AS
MyColumnName
This seems like a limitation of the built-in multivalue capability of Access
2007 but wanted to see if anyone had any other thoughts. I guess that I
could write VBA but was hoping for an easier out.