MS Access Query with CASE statement

后端 未结 1 1171
青春惊慌失措
青春惊慌失措 2021-01-26 11:36

I just want to get the value of one table \"b\" if table \"a\" value is \"-\" If the value at table \"b\" is empty then get the value of table \"a\" even if it\'s \"-\"

相关标签:
1条回答
  • 2021-01-26 12:12

    MS Access does not support CASE statements. Use IIF:

    IIF(tsl.activitat <> '', tsl.activitat, ts.activitat ) AS Activitat
    

    I'm not sure if Access supports aliases on LEFT JOIN either, but it probably does

    Note (although correctly tagged), the title of your question might be troublesome... most people refer to Transact-SQL (TSQL) when writing "MS SQL". Transact-SQL is used by MS SQL Server, but not by MS Access, which uses its own SQL dialect (called "Access SQL", and pretty limited in comparison)

    0 讨论(0)
提交回复
热议问题