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
tidy up service Glenview ..Microsoft Great Plains may be recommended for international freight forwarding... Read More
Spyware, what it is and what it does. Basically, spyware... Read More
If you would like to pick something from Microsoft, or... Read More
Microsoft CRM is new player on the CRM software... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
The stakes are high when considering security, privacy, and savings,... Read More
Now there are Three Steps To Heaven Just listen and... Read More
Microsoft Great Plains serves the wide spectrum of horizontal markets.... Read More
I provide, here clear explanations and a count of function... Read More
Since Version 8.0 Microsoft Business Solutions Great Plains & Great... Read More
If you're online using a dialup Internet connection, you'll probably... Read More
Microsoft Business Solutions CRM is web-based CRM application, deploying all... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
What is Colossus?Colossus is software licensed to about twenty-five insurance... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
Customer Relationship Management (CRM) is a strategy and processes used... Read More
To all web designers out there, this article is for... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
SyncUp, a file synchronizer is designed to assist the home... Read More
Looking at all the ads which promise to get rid... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
maid service near Winnetka ..In a previous article, I wrote about OpenOffice... Read More
In order to implement VLANs in a network environment, you'll... Read More
Lotus Domino/Notes ? Microsoft Great Plains tandem as ERP with... Read More
If you would like to pick something from Microsoft, or... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
2005 ? Back to the Future.What does the future hold?... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Great Plains Software Dynamics, Dynamics C/S+, eEnterprise were written on... Read More
In this small article we will be looking at the... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
Let's first look at your ERP system selection (without Retail... Read More
1. What determines the software price? Is it Per Seat... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
If you copy something from a Web site or elsewhere...... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
The software giants don't do everything and don't always produce... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
Executive SummaryAn effective plan for entering, cleaning and updating the... Read More
Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More
Which Type of Shop Can Rely On A Home Built... Read More
One day, you suddenly realize that your computer started to... Read More
Microsoft Great Plains, designed back in 1990th as database transferable... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
When you visit department stores and see that majority of... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
Software |