J
Jesper F
I have to tables I need output from with som min and max values.
However, the column in the table contains both strings and numbers and I
need MIN and MAX of the numbers off course.
This works is there there are only numbers in the tables:
SELECT table1.varID, table1.varname,
Min(table2.field1) AS Minfield1,
Max(table2.field1) AS Maxfield1,
FROM table1
LEFT JOIN table2
ON table1.varID=table2.varID
GROUP BY table1.varID, table1.varname
But there ARE strings in the column and I'm trying with this:
SELECT table1.varID, table1.varname,
IIF(isnumeric([field1]),Min(table2.field1),'') AS Minfield1,
IIF(isnumeric([field1]),Max(table2.field1),'') AS Maxfield1,
FROM table1
LEFT JOIN table2
ON table1.varID=table2.varID
GROUP BY table1.varID, table1.varname
But I'm getting the error: "you've tried to run a query that doesn't include
IIF(isnumeric([field1]),Min(table2.field1),'') as part of an aggregate
function.".
Can this work? Can I get MIN and MAX values from a column even though
there're strings in the the column?
Thanks.
Jesper
However, the column in the table contains both strings and numbers and I
need MIN and MAX of the numbers off course.
This works is there there are only numbers in the tables:
SELECT table1.varID, table1.varname,
Min(table2.field1) AS Minfield1,
Max(table2.field1) AS Maxfield1,
FROM table1
LEFT JOIN table2
ON table1.varID=table2.varID
GROUP BY table1.varID, table1.varname
But there ARE strings in the column and I'm trying with this:
SELECT table1.varID, table1.varname,
IIF(isnumeric([field1]),Min(table2.field1),'') AS Minfield1,
IIF(isnumeric([field1]),Max(table2.field1),'') AS Maxfield1,
FROM table1
LEFT JOIN table2
ON table1.varID=table2.varID
GROUP BY table1.varID, table1.varname
But I'm getting the error: "you've tried to run a query that doesn't include
IIF(isnumeric([field1]),Min(table2.field1),'') as part of an aggregate
function.".
Can this work? Can I get MIN and MAX values from a column even though
there're strings in the the column?
Thanks.
Jesper