jeffrey.demulling at usbank.com
jeffrey.demulling at usbank.com
Thu Nov 6 09:35:29 CST 2003
The function would probably look something like this: Function MyExample (mycode, mytelling) as Double Dim mymultipler as double Select Case mycode Case 501 mymultipler = 1 Case 503 mymultipler = 2 Case 507 mymultipler = 2 Case 506 mymultipler = .67 Case 502 mymultipler = .4 Case 522 mymultipler = .4 Case 542 mymultipler = .2 Case 500 mymultipler = 0 End Select MyExample = mytelling * myultipler End Function The next step would be to use it in your query something like the following: MyExample([Code], [Telling]) AS Resultaat_Telling FROM TellingCode; jeffrey.demulling at usbank.c om To: "Access Developers discussion and problem solving" Sent by: <accessd at databaseadvisors.com> accessd-bounces at databasead cc: visors.com Subject: Re: [AccessD] why isn't this working? 11/06/2003 09:10 AM Please respond to "Access Developers discussion and problem solving" Why don't you create a custom function for this using Select Case or If Then statements? pedro at plex.nl Sent by: To: AccessD at databaseadvisors.com accessd-bounces at databasead cc: visors.com Subject: [AccessD] why isn't this working? 11/06/2003 06:24 AM Please respond to "Access Developers discussion and problem solving" Hello Group, i can't seem to let this query work. Why? Pedro Janssen SELECT iif([Code]='501',[Telling]*1),iif([Code]='503',[Telling]*2),iif([Code] ='507',[Telling]*2),iif([Code]='506',[Telling]*0,67),iif([Code] ='502',[Telling]*0,4),iif([Code]='522',[Telling]*0,4),iif([Code] ='542',[Telling]*0,2),iif([Code]='500',[Telling]*0) AS Resultaat_Telling FROM TellingCode; _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com