Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return date
Message
De
07/02/2006 09:16:11
 
 
À
07/02/2006 08:58:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01094224
Message ID:
01094244
Vues:
7
hi,
i try , but i get the same error
SET STRICTDATE TO [0 | 1 | 2]  && 
m.a=thisform.text2.value
m.d=thisform.text1.value
GOMONTH({^m.d},- thisform.text2.value)&&the same error message
   thisform.text3.value=GOMONTH
DELETE FROM allres  WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=m.g)&&
>Maybe check the value of SET("STRICTDATE") in your program & see if you either want to change the value of that, or change the code to acccomodate your current STRICTDATE setting. This value can also be adjusted in your development environment under Tools-->Options-->General.
>
>>hi,
>>thank you for reply.
>>i try to do somthing as under i got error message..Ambiguous Date/DateTime constant use the format {^yyyy-mm-dd[,][hh[:mm[:ss]][alp]]}
>>
>>
>>
>>m.a=thisform.text2.value
>>m.d=thisform.text1.value
>>GOMONTH({^m.d}, -m.a)
>>   thisform.text3.value=GOMONTH
>>
>>**&&& no need for  IF && I think
>>m.g=thisform.text3.value
>>DELETE FROM allres  WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=m.g)&&
>>
>>
>>thanks.
>>
>>>Hi Mohammed,
>>> So it looks to me that you gave us some pseudo-code, almost actual code, and you're just looking for the few pieces of Fox syntax to make it work? I wasn't sure what was the question you were asking when I was done reading it. Here are some I see that MAY be of interest to you.
>>>
>>>1) It looks like your date format must be dd/mm/yyyy, right? Check out the GOMONTH() function to quickly move 'n' months in one direction or another.
>>>
>>>2) Consider making a case statement instead of multiple 'ifs'. There was a discussion on universal thread not that long ago about using if vs iif vs case. Some people were hard on one side of the fence or the other, but this looks like a good place to use CASE. The reason being, only 1 of those conditions can ever be true, so there is no need to process ALL of the ifs. With a CASE, once a matching condition is met, the rest of the cases are ignored.
>>>
>>>After the CASE, put that repeated query just once at the very bottom.
>>>
>>>Is this the type of feedback you were looking for?
>>>
>>>>hi all,
>>>>
>>>>any help idea.
>>>>
>>>>i need to delete customer client_no from mynewtable(allres) where found this records at old table (allresdintial) via condition ...ex
>>>>
>>>>
>>>>i have text1 as date and text2 as number got it from combobox have numbers as 3,6,9,12, and field name at newtable and old table is dat.
>>>>
>>>>
>>>> thisform.text1.value=05/06/2006
>>>>if thisform.text2.value=3
>>>>    thisform.text3.value=thisform.text1.value-3 months  && result as 05/03/2006
>>>>
>>>>DELETE FROM allres  WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=thisform.text3.value)
>>>>
>>>>
>>>>if thisform.text2.value=6
>>>>    thisform.text3.value=thisform.text1.value-6 months  && result as
>>>>DELETE FROM allres  WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=thisform.text3.value)
>>>>
>>>>
>>>>if thisform.text2.value=9
>>>>    thisform.text3.value=thisform.text1.value-9 months  && result as
>>>>DELETE FROM allres  WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=thisform.text3.value)
>>>>
>>>>if thisform.text2.value=12
>>>> thisform.text3.value=thisform.text1.value-12 months  && result as
>>>>
>>>>DELETE FROM allres  WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=thisform.text3.value)
>>>>
>>>>
>>>>thanks .
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform