Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor field with 2 decimals ???
Message
From
27/12/2006 08:19:42
 
 
To
27/12/2006 04:14:04
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01180416
Message ID:
01180438
Views:
16
Check the data type of vkpreis. If it is Currency, it will always have 4 decimal places.

>Hello Everybody !
>
>This one makes me crazy !!??
>I need a field vkpreis with 2 decimals to fill an SAP-System with new prices
>
>ODBC-select:
>
>l_select = "select distinct tsttd1.idtnr,tsttd1.beze as bezeichnung," +;
> "tsttd1.beze," +;
> "tsttd1.me,tsttd1.bezug,mbstd1.PEV," + ;
> "mbstd1.verr,mbstd1.mibe,mbstd1.mbmg,mbstd1.lapl,mbstd1.labes,tsttd1.stgew, " + ;
> "' ' as teileart,' ' as vkme,99999.99 as vkpreis,mbstd1.wibzt " +;
> " from mbstd1,tsttd1 " +;
> " where tsttd1.beze <> ' ' and tsttd1.lkz = ' '" +;
> " and tsttd1.idtnr = mbstd1.idtnr " +;
> " and mbstd1.lgidt like '0700%' " +;
> "order by tsttd1.idtnr"
>
>= sqlexec(conn,l_select,"mydata")
>
>browse
>
>vkpreis = 9999,9900 ????????
>
>
>I scan mydata to fill vkpreis from another cursor
>
>scan
>
>IF INDEXSEEK(idtnr,.T.,"einmal") = .T.
> IF einmal.prsneu > 0
> l_vkpreis = ROUND(einmal.prsneu / 100,2)
> replace vkpreis WITH l_vkpreis
> ELSE
> replace vkpreis WITH 0.00
> endif
>
>
> ELSE
> replace vkpreis WITH 0.00
> endif
>
>endscan
>
>vkpreis = 0,000 or 47,2800 ..... ???????
>
>I do a final select
>
>select distinct SUBSTR(idtnr,1,1) + ALLTRIM(SUBSTR(idtnr,1,23)) as idtnr,beze,me,bezug,pev,;
> verr,mibe,mbmg,lapl,labes,stgew,teileart,vkme,ROUND(vkpreis / 1,2) as vkpreis,wibzt ;
> FROM mydata WHERE DELETED() = .F. INTO CURSOR teilekomplett
>browse
>
> vkpreis = 0,000 or 47,2800 ..... ?????
>
>I want vkpreis with 2 decimals ?????
>
>Any help welcomed
>Best regards
>Albert
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform