Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Needed To Update Records
Message
From
19/02/2013 02:54:10
 
 
To
19/02/2013 02:14:37
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01566306
Message ID:
01566348
Views:
37
Just a side note. Why do you write "If Found()=.T."? I find such code difficult to follow. Instead you can just use "If Found()". There is not necessary to check whether true is true, either it's true or it's not.

>Thanks a lot. It worked. However I tried the same SQl on another similar code, but it didn't worked. Please Guide Again
>
>
>Select Subledger
>Go Top
>Scan While .Not. Eof()
>If Left(Vrno,2)=="J-"
>Alldata_Vrno=Vrno
>Select Journal
>Locate For Vrno==Alldata_Vrno
>If Found()=.T.
>SumNaration=Naration1+Naration2+Naration3+Naration4+Naration5
>Endif
>Select Subledger
>Replace Details With SumNaration
>Endif
>ENDSCAN
>
>
>
>Regards
>
>
>
>
>>>I am Using the following code to Update Subledger.DBF file from Schedule.DBF.
>>>Kindly provide me Equivalent SQL to do the same. Currently I am using the following code.
>>>
>>>
>>>
>>>******UPDATE SUBLEDGER DETAILS*******
>>>Goto Top
>>>Scan While .Not. Eof()
>>>T_Newcode=Left(Accode,3)+"0000"
>>>
>>>Select Schedule
>>>Locate For newcode=T_Newcode
>>>If Found()=.T.
>>>T_desc=Desc
>>>Else
>>>T_desc="Account Code Missing"
>>>Endif
>>>Select Subledger
>>>Replace Schedule With T_desc
>>>Endscan
>>>
>>>
>>>
>>>Regards
>>>Harsh
>>
>>UPDATE SubLedger SET Schedule = NVL(Sch.DESC, "Account Code Missing")
>>FROM SubLedger LEFT JOIN Schedule Sch ON Sch.NewCode = LEFT(SubLedger.AcCode,3) + '0000'
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform