>>>NVL() is shorter but neither one will work for SQL Server because it doesn't have IIF() and VFP NVL() is ISNULL() on SQL Server.
>>
>>Would there be any consideration in adjusthing the SQL so I could have something workable if I change the backend without having to change the code?
>>
>>Usually, I do have some method that I call from the data class when I build the SQL command. So, I have one method that does the proper terminology on condition such as:
>>
>>
>> If Not loDataProvider.SQLUpdate("UPDATE Member SET LastHit=?,SessionID=? " + _
>> "WHERE Member.Numero="+loDataProvider.ParameterAddSQL("Numero"), oProcess.oApp.aConnection(1)) Then
>> cHtml = oProcess.cError
>> Return False
>> End If
>>
>>
>>That is from VB.NET when using the VFPOleDb provider.
>>
>>I also have another method when I need to have a condition based on a logical field which is a different syntax in SQL Server. I guess I could build another method which would generate the proper syntax when in need of the NVL() approach.
>
>I don't think there's a code that will work for both. In SQL Server it'll be
>ISNULL(Member.NoSchool,0) AS ...
>
You don't have to worry about result column size because SQL Server will determine it correctly.
this is not true with ISNULL(), uses COALESCE()