Unions and dates
Posted: Fri 14 Aug 2009 12:10
I am trying to join two queries together but I am getting the error:
I boiled an example down to the simplest form:
With tables
The only difference is the one of the date fields is 'not null'. The table definitions cannot change, so does anyone know a workaround please?
Using latest .dotConnect for Postgresql.
Code: Select all
'The type arguments for method 'System.Linq.Enumerable.Union(System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable)' cannot be inferred from the usage. Try specifying the type arguments explicitly.'Code: Select all
var query = ((from table1 in entity.table1
select new
{
Date = table1.StampStart
}).Union(from table2 in entity.table2
select new
{
Date = table2.StampEnd,
}));
Code: Select all
CREATE TABLE "table1"
(
"OIDtable1" serial NOT NULL,
"StampStart" timestamp(0) without time zone NOT NULL
);
CREATE TABLE "table2"
(
"OIDtable2" serial NOT NULL,
"StampEnd" timestamp(0) without time zone
);Using latest .dotConnect for Postgresql.