Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date should be greater than specified for not empty date
Message
 
 
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 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01151040
Message ID:
01151045
Vues:
23
>>Hi everybody,
>>
>>I have this inner select (used to join with other tables):
>>
>>
>>select ;
>>NVL(EQS.tScheduled_Time, <<m.lcFutureDate>>) ;
>>	as tScheduled_Time, TEQ.tExpire_date, ;
>>TEQ.cTrans_Employees_Queues_Pk,  ;
>>TEQ.cTrans_fk from Trans_Employees_Queues TEQ ;
>>LEFT JOIN Employee_Queue_Schedules EQS ON ;
>>TEQ.cTrans_Employees_Queues_pk = ;
>>EQS.cTrans_Employees_Queues_fk ;
>>and EQS.iActive_Flag = 1 ;
>>where TEQ.cCommission_Owner_UsGrLink_fk IS NULL ;
>>and TEQ.cQueue_names_fk = '<<m.tcQueuePk>>' ;
>>and TEQ.iActive_Flag = 1
>>
>>Now I want to add an additional filter for EQS.tScheduled_Time. If it's not empty, it should be less or equal tdAssignDate. My question is how should I write this additional filter. As you see, I use
>>
>>NVL(EQS.tScheduled_Time, <<m.lcFutureDate>>) ;
>>	as tScheduled_Time, TEQ.tExpire_date, ;
>>
>>
>>
>>I may not have records in EQS. If I do have records, they do have tScheduled_Time and I want this time to be less than passed date, e.g. if I have record scheduled in 45 days, I don't want it to be assigned today.
>>
>>So, what do you think I should do? Should I try to use step1 results (this select used as an inner select and called step1). I would not have an index on the date then...
>>
>>What do you think?
>>
>>Thanks a lot in advance.
>
>This would work:
>(EQS.tScheduled_Time is NULL or EQS.tScheduled_Time < <<m.lcAssignDate>>))
>
>but I'm not sure this code is efficient.

I think I just put the condition into the JOIN <g>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform