Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unexplained value in SQL field
Message
De
09/10/2006 12:07:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/10/2006 12:03:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01160578
Message ID:
01160581
Vues:
8
>I have a SQL command like this:
>
>
>SELECT Video.Numero,Video.Active2,Video.DateR,Video.Notes_E,Video.Notes_F,Video.Running,Video.VideoT,Video.NoVideoT,Masters.FirstName,;
> Masters.LastName,Video.NoVideoL,Video.NoMaster,Video.NoMaster2,Video.NoMaster3,Video.NoMember,;
> VideoType.Title_E AS VideoType,VideoLanguage.Title_E AS VideoLanguage,Programs.ProgramT,Video.NoProgram,;
> IIF(ISNULL(Member.NoSchool),0,Member.NoSchool) AS NoSchool,School.SchoolT,Video.NoClass,;
> VideoClassification.Title_E AS Classification,Video.Url,School.Url AS SchoolUrl,VideoSize.VideoSizeT,;
> Video.NoMember2,Member2.FirstName,Member2.LastName;
> FROM Video;
> INNER JOIN Masters ON Video.NoMaster=Masters.Numero;
> INNER JOIN VideoType ON Video.NoVideoT=VideoType.Numero;
> INNER JOIN VideoLanguage ON Video.NoVideoL=VideoLanguage.Numero;
> LEFT JOIN Programs ON Video.NoProgram=Programs.Numero;
> LEFT JOIN Member ON Video.NoMember=Member.Numero;
> LEFT JOIN School ON Member.NoSchool=School.Numero;
> INNER JOIN VideoClassification ON Video.NoClass=VideoClassification.Numero;
> INNER JOIN VideoSize ON Video.NoVideoSiz=VideoSize.Numero;
> LEFT JOIN Member AS Member2 ON Video.NoMember2=Member2.Numero;
> WHERE Video.Active2 AND Video.DateR<={^2006/10/09 07:46:15}
>
>
>As is, the result in the NoSchool field would be having a size of one for the NoSchool field. Thus, I end up with some * in some records because I have values higher than 9 in some records.
>
>However, if I remove the second part of the where clause, which is the Video.DateR filter, the NoSchool field would then be ok.
>
>Can someone explain me that where behavior?

Michel,
Would you try this:
IIF(ISNULL(Member.NoSchool),0,Member.NoSchool) AS NoSchool
replaced with:
nvl(Member.NoSchool,0) AS NoSchool

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform