2011-08-01 20 views
5

Bir alandaki değer boşsa VEYA değeri alan seçkisiz bir tablodan null değilse, "NONE" değerini göstermek istiyorum. ifadesi buna benzer olabilir:MS Access SQL alan değerindeki NULL yerine

select iif(isnull(spouse),"NONE",spouse) as spouse from biodata 
+1

Bu işe yaramadı mı? – JeffO

+0

Eh, bir ad çakışması var, bu takma ad, temel alan ile aynı addır. Çalışmak için, daha spesifik olması gerekiyordu: 'IIf (IsNull (biodata.spouse)," NONE ", biodata.spouse) Eş olarak –

cevap

8
SELECT Nz(spouse,"NONE") AS Nzspouse FROM biodata 

Nz() aksi takdirde spouse döndürür NULL oldu "NONE"spouse eğer ile spouse değiştirir.