Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unexplained value in SQL field
Message
 
To
09/10/2006 12:12:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01160578
Message ID:
01160618
Views:
8
>>Would you try this:
>>IIF(ISNULL(Member.NoSchool),0,Member.NoSchool) AS NoSchool
>>replaced with:
>>nvl(Member.NoSchool,0) AS NoSchool
>
>Yes, that would resolve the issue. The same would go with:
>
>
>IIF(ISNULL(Member.NoSchool),000000,Member.NoSchool) AS NoSchool
>
>
>But, I am looking to understand why removing a where clause causes the data to be different. This simply doesn't make any sense to me.
>
>As for the updated SQL, such as how I did it or considering your approach, I am looking for the best approach that would allow me less changes when the data would be migrated to SQL Server. Do you know if anyone of those approaches are compliant with SQL Server:
>
>
>IIF(ISNULL(Member.NoSchool),000000,Member.NoSchool) AS NoSchool
>NVL(Member.NoSchool,0) AS NoSchool
>
In SQL Server they must be:
*** Replacement of VFP NVL(...) function
ISNULL(Member.NoSchool,0)
* or
COALESCE(Member.NoSchool,0) && I prefer this because COALESCE coinvert the result to higher field type


***  Replacement of IIF(....)
CASE WHEN Member.NoSchool IS NULL THEN 0 ELSE Member.NoSchool END
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform