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
quick home cleaning Glenview ..Microsoft Business Solutions Great Plains has Project Accounting module where... Read More
Mike Dunville* had a decision to make. As the new... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
Usually, the easiest way to tell you have spyware is... Read More
Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More
The cornerstone of successful automated office systems is the ability... Read More
Considering whether or not your software company should hire a... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
The intuitive algorithm.Roger Penrose considered it impossible. Thinking could never... Read More
If you have been running Windows XP for a couple... Read More
In order to implement VLANs in a network environment, you'll... Read More
Microsoft Word is one of the most popular office applications... Read More
Former Great Plains Software Dynamics/eEnterprise, and currently Microsoft Business Solutions... Read More
.Net Framework is a platform or development environment to seamlessly... Read More
If you have Microsoft Great Plains and support it for... Read More
Program Flow is what you think it is. How the... Read More
I love new technology. I am still ready to wait... Read More
As we could imagine, if you are reading this article... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
This is a short article, written in question/answer/FAQ style to... Read More
With any good luck and a good amount of hard... Read More
With this small article we are continuing Microsoft Business Solutions... Read More
Our company, Novaprof Inc., developed unique software - DB Integration.... Read More
Did you ever want to erase everything on your computer?... Read More
scheduled maid service Winnetka ..Remember old good days when your company probably had Great... Read More
TCO (Total Cost Ownership) is the buzzword in... Read More
Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
Microsoft Business Solutions Navision serves both European and American megamarkets.... Read More
Is your PC is slow and wimpy? Then you need... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
Microsoft Business Solutions products: Great Plains, MS CRM, Navision, Axapta,... Read More
If you copy something from a Web site or elsewhere...... Read More
Icons are used everywhere; right from software applications, to internet... Read More
Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
If you have Great Plains Dynamics/eEnterprise (version 6.0 or earlier)... Read More
I've been active in the Cisco Certification track for four... Read More
1. Replace Dexterity cursor with SQL Stored Procedure Dexterity... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
Homeland security, airport security, Internet security ??" these days we???re... Read More
Customer Relationship Management or CRM is a combination of enterprise... Read More
A wiki is an editable text-based website. But you don't... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
Need software to record your voice, streaming audio or musical... Read More
The purpose of one of our projects was MS Exchange... Read More
Microsoft Great Plains may be recommended for international freight forwarding... Read More
Microsoft Great Plains is now standard mid-market ERP application, serving... Read More
Every organization which creates collaborative documents, whether they are budgets,... Read More
Here is some free software tools to help you build... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
Software |