How to return more than one value from a function?

Answer Posted / ravivarman_r

Public Type Income
Wages As Currency
Dividends As Currency
Other As Currency
Total As Currency
End TypeYou can now use this structure as the return
type for a function. In a real situation, the function
would look up your database tables to get the values, but
the return values would be assigned like this:

Function GetIncome() As Income
GetIncome.Wages = 950
GetIncome.Dividends = 570
GetIncome.Other = 52
GetIncome.Total = GetIncome.Wages +
GetIncome.Dividends + GetIncome.Other
End FunctionTo use the function, you could type into
the Immediate Window:

GetIncome().Wages

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is varchar data type in sql?

520


How do I start sql from command line?

536


what are local and global variables and their differences? : Sql dba

541


Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql

531


what are the difference between clustered and a non-clustered index? : Sql dba

529






What is break?

620


What is minus?

547


How do you copy a table in sql?

563


What is sql select statement?

505


Which is better varchar or nvarchar?

550


Which data dictionary views have the information on the triggers that are available in the database?

756


what is the use of set statement in tsql? : Transact sql

536


What are two statement types in sql?

540


What are commit, rollback, and savepoint?

569


Is keyword pl sql?

561