Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do this replace
Message
From
13/09/2007 09:08:18
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brazil
 
 
To
13/09/2007 08:49:11
Mk Sharma
Shrishti Solutions
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01254065
Message ID:
01254082
Views:
16
Mk,

>i have 2 dbfs
>
>1. taxmaster.dbf
>
>taxmaster.dbf have 2 fields
>
>
>Effdate  d      && effective date
>taxrate  n(5,2) && tax rate
>
>records in taxmaster.dbf    && no of records can change in taxmaster.dbf
>
>Effdate      Taxrate
>01.04.2007     0.00
>15.06.2007     4.00
>01.07.2007    12.50
>
>
>
>
>schild.dbf have 6 fileds && more than 5000 records with diffrent billdates.
>
>billdate d
>billno   c(8)
>product  c(50)
>quantity n(10,3)
>rate     n(10,2)
>taxrate  n(5,2)
>
>
>billdate     billno      product       quantity      rate   taxrate
>02.04.2007   001001      abc             5           500.00   ??       should be  0.00
>03.04.2007   001001      abc             5           500.00   ??       should be  0.00
>04.04.2007   001001      abc             5           500.00   ??       should be  0.00
>05.05.2007   001001      abc             5           500.00   ??       should be  0.00
>04.06.2007   001001      abc             5           500.00   ??       should be  4.00
>05.06.2007   001001      abc             5           500.00   ??       should be  4.00
>08.06.2007   001001      abc             5           500.00   ??       should be  4.00
>10.07.2007   001001      abc             5           500.00   ??       should be 12.50
>12.07.2007   001001      abc             5           500.00   ??       should be 12.50
>18.07.2007   001001      abc             5           500.00   ??       should be 12.50
>21.07.2007   001001      abc             5           500.00   ??       should be 12.50
>25.07.2007   001001      abc             5           500.00   ??       should be 12.50
>
>
>
>i want to update taxrate in schild.dbf from taxmaster.dbf as per billdate.
>
>
>warm regards,
>mk.

Quickly, try it:
UPDATE sChild SET taxRate = NVL((Select taxRate From taxMaster;
	WHERE taxMaster.effDate = sChild.billDate), taxRate)
P.S.: I think that isn't better option in relation about performance.
Erick
Força Sempre!
Strength Always!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform