Microsoft Great Plains: Interest Calculation Example – Stored Procedure for Crystal Report
This is intermediate level SQL scripting article for DB Administrator, Programmer, IT Specialist Our and Microsoft Business Solutions goal here is to educate database administrator, programmer, software developer to enable them support Microsoft Great Plains for their companies. In our opinion self support is the goal of Microsoft to facilitate implementation of its products: Great Plains, Navision, Solomon, Microsoft CRM. You can do it for your company, appealing to Microsoft Business Solutions Techknowledge database. This will allow you to avoid expensive consultant visits onsite. You only need the help from professional when you plan on complex customization, interface or integration, then you can appeal to somebody who specializes in these tasks and can do inexpensive nation-wide remote support for you. Let's look at interest calculation techniques. Imagine that you are financing institution and have multiple customers in two companies, where you need to predict interest. The following procedure will do the job: CREATE PROCEDURE AST_Interest_Calculation @Company1 varchar(10), --Great Plains SQL database ID @Company2 varchar(10), @Accountfrom varchar(60), @Accountto varchar(60), @Datefrom datetime, @Dateto datetime--, as declare @char39 char --for single quote mark declare @SDatefrom as varchar(50) declare @SDateto as varchar(50) select @SDatefrom = cast(@Datefrom as varchar(50)) select @SDateto = cast(@Dateto as varchar(50)) select @char39=char(39) if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AST_INTEREST_TABLE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) CREATE TABLE [dbo].[AST_INTEREST_TABLE] ( [YEAR] [int] NULL , [MONTH] [int] NULL , [COMPANYID] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ACTNUMST] [char] (129) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [BEGINDATE] [varchar] (19) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ENDDATE] [varchar] (19) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [YEARDEGBALANCE] [numeric](19, 5) NULL , [BEGBALANCE] [numeric](38, 5) NULL , [ENDBALANCE] [numeric](38, 5) NULL , [INTERESTONBALANCE] [numeric](38, 6) NULL , [INTERESONTRANSACTIONS] [numeric](38, 8) NULL , [INTEREST] [numeric](38, 6) NULL
) ON [PRIMARY] exec(" delete AST_INTEREST_TABLE where [YEAR] = year("+ @char39 + @Datefrom + @char39 +") and [MONTH]=month("+ @char39 + @Datefrom + @char39 +") insert into AST_INTEREST_TABLE select year(X.BEGINDATE) as [YEAR], month(X.BEGINDATE) as [MONTH], X.COMPANYID, X.ACTNUMST, X.BEGINDATE as BEGINDATE, X.ENDDATE as ENDDATE, X.YEARBEGBALANCE as YEARDEGBALANCE, X.YEARBEGBALANCE+X.BEGBALANCE as BEGBALANCE, X.YEARBEGBALANCE+X.ENDBALANCE as ENDBALANCE, X.INTERESTONBALANCE as INTERESTONBALANCE, X.INTERESTONTRANSACTIONS as INTERESONTRANSACTIONS, X.INTERESTONBALANCE+X.INTERESTONTRANSACTIONS as INTEREST --into AST_INTEREST_TABLE from ( select "+ @char39+ @Company1 + @char39+" as COMPANYID, a.ACTNUMST, "+ @char39 + @Datefrom + @char39 +" as BEGINDATE, "+ @char39 + @Dateto + @char39 +" as ENDDATE, case when b.PERDBLNC is null then 0 else b.PERDBLNC end as YEARBEGBALANCE, sum ( case when (c.DEBITAMT-c.CRDTAMNT is not null and c.TRXDATE ="+ @char39 + @SDatefrom + @char39 +" and c.TRXDATE =year("+ @char39 + @Datefrom + @char39 +") where a.ACTNUMST>="+@char39+@Accountfrom+@char39 +" and a.ACTNUMST="+ @char39 + @SDatefrom + @char39 +" and c.TRXDATE =year("+ @char39 + @Datefrom + @char39 +") where a.ACTNUMST>="+@char39+@Accountfrom+@char39 +" and a.ACTNUMST

Other Article Sites
findabook.com moneycd.info a-mortgage.info
about-lemon-laws.info aboutstudentloans.info
all-about-publishing.info auctions-articles.info bestcollege-university.com bestispconnection.com
biblefolder.com blogger-website.com books-used.info brokers-guide.info buywindows.info cable-dsl.info
career-miner.com carpel-tunnel.info cashinaflash.info cashloanreviews.info casinobell.com chat-house.info
clearmycredit.info collegeloantips.info crones.info depression-articles.info
dirnic.net dishguides.info
divers-below.com expodog.info
financewizz.com fire-insurance.info getgood.info handleit.net
it-idea.info
health-supplies.info hosting-right.com insidealert.com insurance-facts.info jobs-employment.info
justgood.info lookgold.net
lowcost-travel.info money-source.info myhostzone.info numisblog.com
peoplesearchfinder.info pr-articles.info realeas.com
refinancing-guides.info spyware-remove.info
telelot.info the-law.info
toppaid.info travel-deals.info travelcorrect.com wedding-guide-site.com
your-blog.info your-credit.info
|
 |
 |
 |
MORE ARTICLES:
Cheap Mortgage Insurance: Offering You Peace Of Mind
There can be no worse feeling than staring the prospect of losing your home directly in the face. This is the reality faced by many individuals in the UK every day, and yet it is easily preventable with cheap mortgage insurance. Far less people protect their mortgages with cheap mortgage insurance when they are initially approved for their mortgage because they perceive mortgage payment protection insurance as redundant. However, it is the ?what ifs? in life that can cause us the most problems.
A Review of the E-Bullion Payment Service
In an effort to build up finances for retirement, or to invest in something that will help in the future, people are turning to a variety of options that do not include the standard stocks and bonds that go up and down like yo-yo?s They are turning to alternative ways to build their future, and bullion is one of them
5 reasons why mortgage advice services are essential in todays climate
With the global credit crunch hitting the headlines day after day, if you are searching for a mortgage a new landscape has developed.
Jump In The Technology Bandwagon With Refinance Mortgage Arizona
It?s funny how computer companies that were nonexistent a quarter of a century ago are now setting trends and milestones for older and supposedly more established companies. When Microsoft and America Online outsourced some of their services to India and the Philippines, other companies with services ranging from automotive to medical followed suit. When the software company Intuit started utilizing the vast Arizona deserts and plains, others started seeing the possibilities.
For maximum return on investment, Get your best home improvement loan
One of the most popular and cost-effective guaranteed online personal loans are your home improvement loan. It is quite functional for any kind of home extensions and renovations. Usually, home improvement loans california refinance mortgage loan can be availed for revamping your kitchen, add an extra bathroom, get double glazing or a complete home remodeling, or any thing that you can think of to add new look to your house as well as improve its value on the whole.
Home Loan Rate: Compare Before You Pick One
A home loan rate can either make or break your finances That?s why you need to know how to look for an interest rate that fits your needs by comparing them
Things to Consider Before Refinancing Your Home
Home refinancing is a big business these days to save your home from foreclosure and to save you money Refinancing your home should be done for the right reasons to make sure that you make the best decision for you and your family
Caryl Serbin Will Be the Featured Speaker at "Prepare for the Path Ahead" A Seminar Preparing ASCs for Changes in the Medicare Payment Syste
Caryl Serbin, President and founder of Surgery Consultants of America, Inc. (SCA) and Serbin Surgery Center Billing, LLC (SCB) will present necessary tools and information that surgery centers need for the upcoming changes to the Medicare payment system in the Ambulatory Surgery Center (ASC) industry. The event is being held by the American Association of Ambulatory Surgery Centers (AAASC).
Avoiding College Credit Card Traps
Congratulations college freshman! You're about to embark on one of the most exciting times of your life. By now your parents, siblings, and friends have offered you all kinds of advice on how to make your transition to college smoother - how to get along with your roommate, what classes to take and which ones to avoid, where to find the best off-campus food, and how to stay safe on campus.
PayDay Loan Online - Quick Cash Advance Loans Online Are Very Convenient
Getting a quick cash loan, cash advance or payday loan has never been easier than it is today, thanks to the internet. Today you can apply and be approved for a payday loan or cash advance fast, in the comfort of your own home.
Cheap Payday Advance Loan: borrow money through cheap payday advance loan
Resources are limited for lending money and requirements of money are plenty because the people meet day to day worthless expenses. Diminishing these problems cheap payday advance loan gives you a potential offer. Cheap Payday Advance Loan is the short-term loan availed between two consecutive paydays. Cheap Payday Advance Loan can be availed by all the people who are working and earning enough to repay the Cheap Payday Advance Loan. Credit history does not matter to borrow Cheap Payday Advance Loan for the lenders who provide Cheap Payday Advance Loan, whether you have good credit history or bad credit history you are eligible to avail Cheap Payday Advance Loan.
Which Of The Mortgage Rates Is Right For You?
Finally, you have found the house of your dreams You can now decide on the amount that you want to borrow and also your downpayment for it
Self Employed Mortgage Loans - A Survival Guide
When you're self employed you have numerous advantages. As you are a free agent, you will write off every deduction you can on your tax return.
How Beneficial Is A Home Equity Loan?
Before I answer the question, let me try and explain what a home equity loan exactly is.
Apply For A Business Credit Card Online, The Convenient Way
Finally, your dream of becoming a business owner has come true. You have your business plan ready, you have worked everything out, contacts with the suppliers has been made, deals and agreements are looming, but you still don?t have a business credit card. So what? Is it really that important?
|