Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Tom Saddul
  Where is Tom Saddul?
 Paranaque
 Philippines
 Tom Saddul
Subject: RE: VFP Currency and Numeric Conflicts
Thread ID: 159114 Message ID: 159152 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Saturday, February 2, 2008 6:19:42 PM         
   



Tom

What is oConn. You may have to check the ExecQuery method there. or your tnDivide may be currency.

Regards
Tushar
> This is a method of a VFP form that computes and stores the Medicare Premium.
> Notice the last line of the VFP method I have to use MTON() because when I debugged the program, the variable lnPremYee is a Currency.
>
>
> LPARAMETERS tnPeriod, tnMonthlyBasic, tnDivide
> LOCAL lnPremYee, lnPremYer, lnDiff
> 
> IF THISFORM.oConn.ExecQuery( ;
> 	"SELECT PremYee,PremYer,PremYeep,PremYerp FROM Med" + ;
> 	" WHERE Max>=" + TRANSFORM(tnMonthlyBasic) + ;
> 	" ORDER BY Max LIMIT 1"))
> 	lnPremYee = TmpConn.PremYee
> 	lnPremYer = TmpConn.PremYer
> 	IF tnPeriod = goSet.nMedDiff
> 		lnDiff = (lnPremYee - TmpConn.PremYeep) * goSet.nMedMos
> 		lnPremYee = lnPremYee + lnDiff
> 		lnDiff = (lnPremYer - TmpConn.PremYerp) * goSet.nMedMos
> 		lnPremYer = lnPremYer + lnDiff
> 	ENDIF
> 	lnPremYee = ROUND(lnPremYee / tnDivide, 2)
> 	lnPremYer = ROUND(lnPremYer / tnDivide, 2)
> 	WITH THISFORM.oPrmLedger
> 		.cType		= PRM_MEDICARE
> 		.nPremYee	= lnPremYee
> 		.nPremYer	= lnPremYer
> 		.nPremEc	= 0
> 		.NewRecord()
> 	ENDWITH
> ELSE
> 	lnPremYee = 0.0
> ENDIF
> RETURN MTON(lnPremYee)
> 

>
>
> Here is the SQL command that created the table:
>
> CREATE TABLE `med` (
> `id` tinyint(3) unsigned NOT NULL auto_increment,
> `code` char(5) NOT NULL default '',
> `max` decimal(9,2) NOT NULL default '0.00',
> `credit` decimal(9,2) NOT NULL default '0.00',
> `premyer` decimal(9,2) NOT NULL default '0.00',
> `premyee` decimal(9,2) NOT NULL default '0.00',
> `premyerp` decimal(9,2) NOT NULL default '0.00',
> `premyeep` decimal(9,2) NOT NULL default '0.00',
> PRIMARY KEY (`id`),
> KEY `code` (`code`),
> KEY `maxindex` (`max`)
> ) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=latin1;

ENTIRE THREAD

VFP Currency and Numeric Conflicts Posted by tom saddul @ 2/2/2008 10:21:11 AM
RE: VFP Currency and Numeric Conflicts Posted by Borislav Borissov @ 2/2/2008 10:41:29 AM
RE: VFP Currency and Numeric Conflicts Posted by tom saddul @ 2/2/2008 12:02:44 PM
RE: VFP Currency and Numeric Conflicts Posted by Andy Kramek @ 2/2/2008 12:39:42 PM
RE: VFP Currency and Numeric Conflicts Posted by tom saddul @ 2/2/2008 1:45:27 PM
RE: VFP Currency and Numeric Conflicts Posted by Borislav Borissov @ 2/2/2008 12:51:45 PM
RE: VFP Currency and Numeric Conflicts Posted by tom saddul @ 2/2/2008 1:37:53 PM
RE: VFP Currency and Numeric Conflicts Posted by Borislav Borissov @ 2/2/2008 1:49:44 PM
RE: VFP Currency and Numeric Conflicts Posted by tom saddul @ 2/2/2008 3:29:55 PM
RE: VFP Currency and Numeric Conflicts Posted by tushar @ 2/2/2008 3:38:26 PM
RE: VFP Currency and Numeric Conflicts Posted by Tom Saddul @ 2/2/2008 4:34:38 PM
RE: VFP Currency and Numeric Conflicts Posted by tushar @ 2/2/2008 6:19:42 PM
RE: VFP Currency and Numeric Conflicts Posted by suhas hegde @ 2/2/2008 4:19:13 PM
RE: VFP Currency and Numeric Conflicts Posted by Tom Saddul @ 2/2/2008 4:48:29 PM
RE: VFP Currency and Numeric Conflicts Posted by suhas hegde @ 2/2/2008 6:54:41 PM