i have this sql query for mysql that works well. the query finds in 2 tables wich is the max numeric value from both and returns the value good in mysql, i have to do the same query in sql server but tells me an error syntax error near cast, expects as
the query is the next :
SELECT MAX(CAST(RIGHT(nrt, 5) AS UNSIGNED))
FROM
(
SELECT nrt from asp where nrt != ' ' and nrt is not null
UNION ALL
SELECT nrt from asp_historic where nrt != ' ' and nrt is not null
) as subQuery
there is a way to do that the this query runs?