Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPT No-Go With SELECT WHERE Multi-Condition?
Message
De
09/09/2000 04:08:32
 
 
À
07/09/2000 09:51:16
Dave Ten Broeck
Hartford Financial Services
Simsbury, Connecticut, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00413450
Message ID:
00414575
Vues:
18
>Can we build SPT using the SQLEXEC(x,SELECT...,) that has multi join conditions on the WHERE?
>
>I created many WHERE conditions within a Remote View & wanted to paste the SQL into a .prg to use with SPT. I have a smaller sample of code below...it has a WHERE AND
>I've tried many times with different multi-conditions but it doesn't work. It works fine with a single WHERE but when I add an "ADD", my SPT .prg won't work? (should be some syntax issue...?)
>
>Is anyone getting this to work? Any examples? Yes, I'm new to SPT but I haven't had this problem on my other non-SPT SQL. Any ideas?
>
>Thanks...
>
>
>LOCAL lnhandle
>lnhandle = SQLCONNECT("Fnxpro1")
>
>SQLEXEC (lnhandle,"SELECT Fltrade.TRCUS, Fltrade.TRTAM, Fltrade.TRTDTE, Fltrade.TRCAM,;
> Fltrade.TRCSQ, Fltrade.TRCPC, Fltrade.TRCNF, Fltrade.TRDST, Fltrade.TRCAT,;
> Fltrade.TRRAN, Fltrade.TRPDTE;
> FROM FUNDLINX.FLTRADE Fltrade;
> WHERE {fn month(Fltrade.trtdte)} >= ?ccMonth;
> AND Fltrade.TRCAT <> 'VARIC'")


I had used SPTs extensively (for both type of back-ends VFP & Oracle). You can use WHERE clause also for Join (except outer join in VFP where you need to use OUTER JOIN clause, but in Oracle (+) clause) along with your normal filter expressions.

In your above query I did not understand one part which is {fn month(Fltrade.trtdte)}. What is this "fn" declaration? Does it mean function month defined as a stored procedure? What is your back-end? (Of course, I have not worked with SQL server as back-end).

If you cannot find a decent way to get around with then I can suggest another way. Use "Between" clause with starting date of the month and ending date of month. In that case you can avoid using stored procedure with AND clause.

Regards
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform