Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Too many args in my complex SQL
Message
 
 
À
31/08/2007 04:29:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01251397
Message ID:
01251611
Vues:
15
Hi Terry,

In your query you have 2 periods: ldStartCurr - ldEndCurr and ldStartPrev - ldEndPrev. According to you query itself didn't change but definiton of those periods did (sometimes).
You can either create and use new variables for those periods if you have to preserve their values or assign new values to the same variables. Something like
IF EMPTY(ldEndPrev)
	ldEndPrev = ldStartCurr
ENDIF
>Sorry, I missed that part of your original message when I got engrossed in answering the first part.
>
>How redefine start and end of the periods?
>
>>If you follow my suggestion, you wouldn't have embedded IIF() in the first place.
>>
>>>Hi Sergey. Thanks for the attention.
>>>
>>>You see the old snippet below, commented out?
>>>So, if ET.Date was between the curr period start and end dates it was summed.
>>>Similarly, if it fell between the prev period start and end dates it was summed.
>>>
>>>However, there might not be start curr period date, or end prev period date so, respectively, the ET.Date would need to be between the end prev period and end curr period, or start prev period and start curr period.
>>>
>>>Whether or not my logic is flawed here (:-), I amn experimenting to get mself out of an anomolie that's not worth (or really possible easily) to explain here, and I mainly want to know where the niggling error is. That's why I've elaborately laid out the code, to saee what args go with what funcs more easily.
>>>
>>>Cheers
>>>
>>>>Hi Terry,
>>>>
>>>>Your SQL doesn't match what you are saying you're trying to do. Can you clarify your intentions?
>>>>Anyway, you should redefine begining and end of each period instead of complication query itself.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform