Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test with sql
Message
 
À
08/02/1999 17:27:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00185305
Message ID:
00185437
Vues:
19
>Hey
>
>I want make a test in the command windows.
>
>1) I open the table in my deta session
>2) I put a date in my var
>
>When i try this. Error Operator/operand typy mismatch
>
>3) SELECT *, .T. AS cFlag FROM hold WHERE between(hold.date_prod,
> Date1, ?Date2)AND !DELETED() INTO CURSOR tmpHold
>
>Where is my problem, behind the keyboard I know

Hi Pierre,

The question mark before the Date2 parameter is perfectly acceptable. This is not where the problem is, provided the "date var" you are populated with a valid date value is Date2. The problem could be related to your mixinf the * with a column assignment statement in the SQL syntax. I don't think you are allowed to mix a "SELECT *..." with a column creation statement like ".T. as tFlag".

Try issuing the required field name list with the select statement, as in

SELECT firstname, lastname, date_prod, .T. as tFlag FROM hold INTO...

You get the idea. Also, if you are not using *every* field in the result cursor, avoid using the "SELECT *..." approach. When you start dealing with larger record sets, select statements that grab all fields tend to be quite slow, as only the indexed fields are optimizable in the SELECT statement by Rushmore. The difference in query processing time would surprise you.

Phil
Phil
_____________________________
Phil Miles
http://www.philmiles.com
phil@philmiles.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform