Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with ORDER on an SQL giving wierd error
Message
De
15/09/1999 13:48:03
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Help with ORDER on an SQL giving wierd error
Divers
Thread ID:
00265100
Message ID:
00265100
Vues:
55
I have a select statement that is producing an error that after TOOOO many hours was able to figure out WHAT was causing but not sure why...

Here is the statement as I had it written....

Select client.clientnum, client.clientname, ;
Trim(code.codenum)+" "+code.codedesc as code, ;
Trim(employee.lastname)+", "+employee.firstname as employee, ;
log.logdate, ;
log.time, ;
log.rate, ;
log.time*log.rate as amount ;
from Timepro!log left join timepro!employee on log.employeeid = employee.employeeid ;
inner join timepro!code on log.codeid = code.codeid ;
inner join timepro!client on log.clientid = client.clientid ;
where log.firmid=gFirmid and log.logdate>=gStartdate and log.logdate<=gEnddate and log.employeeid<>0 ;
into cursor curswip ;
order by client.clientname, val(code.codenum),employee


The error I was getting is
SQL ERROR: Column CLIENTNAME is not found


After extensive trial an error, if I remove the VAL() from around the field CODE.CODENUM the error disappears - now just the sorting order is wrong (10,15,1000,1100,20,2000,30,40 instead of 10,15,20,30,40,1000,1100,2000). I most likely will be switching the field for CODE.CODENUM to a numeric instead of a text but shouldn't my SELECT statement have worked and what does that have to do with CLIENTNAME. I spent so much time trying to figure out why CLIENTNAME was messing up
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform