Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about SQL Server and Stored Procedures...
Message
 
 
À
17/04/2001 15:55:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00494976
Message ID:
00496401
Vues:
27
Daniel,
I have done some of this type conversion and there are lots of ways to do this based on the situation. If these queries are used mostly for reports only, I would build the SQL string in foxpro and pass the string to SQL in a pass-thru statement. You might want to research the CASE statement in SQL which is very different than the Fox Case statement. I hope this at least help points you in a good direction.

lcLabno = .cLabno
lcFilter = [ labbatch.labno = ']+lcLabno+[' AND ]+ ;
[labbatch.dateofserv BETWEEN ']+DTOC(.dStartDate)+[' AND ']+DTOC(.dEndDate)+[' ]
lcOrderBy= [ ORDER BY Labbatch.dateofserv, ]+;
[patname, Labbatch.batchorig, Labbatch.lesionno]

SQLEXEC(1,[SELECT Labbatch.batchno, Labbatch.dateofserv dateofserv, abs.name, ]+;
[Labbatch.batchorig, Labbatch.testname, ]+;
[RTRIM(ISNULL(patient.lname,''))+', '+LTRIM(RTRIM(ISNULL(patient.fname,''))+' ')+RTRIM(ISNULL(patient.mid,'')) patname, ]+;
[patient.patientno, location, SPACE(4) AS measvalue, SPACE(10) AS DESCRIPTION ]+;
[FROM labbatch,batchinfo,labs,patient ]+;
[WHERE labbatch.batchorig = batchinfo.batchorig ]+;
[AND Labbatch.labno = labs.labno ]+;
[AND labbatch.patientno = patient.patientno ]+;
[AND labbatch.doctorno = ']+oWOVar.cPhysician+[' ]+;
[AND ]+lcFilter+lcOrderBy,'lvPatLabFilter')

I apologize for the syntax. I cut this out of a program hoping it might help you. In the were clause of this statement joins should be being used. The idea is here anyway. Good Luck!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform