Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test with sql
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00185305
Message ID:
00185485
Vues:
18
>>>>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
>>
>>Ehhhr Michelle?
>>
>>Philip is right. SQL accepts the ?. Wonder what that does to _our_ egoes :). And Philip, thanks for straightening us out.
>>
>>Philip, notwithstanding your relevant remarks about the use of *, sql accepts the creation of columns after a * clause.
>>
>>We're back to square one.
>>
>>Marc
>
>Not necessarily square one. Notice "provided 'date var' is populated with a valid date." If it's not, that could still be the problem. ?Var doesn't work to provide p-view-like behavior in SQL, only works like macro-substitution if the var is defined, if I'm reading Mr. Miles' post correctly.
>
>Cheers,

To clarify my previous post (since Pierre said he populated his var), I'm guessing that since he's got one var with a ? and one without, he filled in the var without the ? and expected to be asked for the value of the other. Is that true, Pierre? Sorry if I made a mistake.

Cheers,
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform