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
bmw rental chicago Bensenville .. Lockport Chicago limo O’HareI have yet to see a business that, sometimes in... Read More
Just when you thought you were Web savvy, one more... Read More
Adware is a type of Spyware program that displays some... Read More
The purpose of one of our projects was MS Exchange... Read More
I've been active in the Cisco Certification track for four... Read More
Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More
ERP (Enterprise Resource Planning) Overview covers What is ERP, Brief... Read More
Features Additionally, Vista will include many other new features.Aero Vista... Read More
Manufacturing in the USA is far away down from mid... Read More
Software Engineering is the Systematic Approach for analysis design implementation... Read More
Domino server is a buffer between the operation system and... Read More
So let's begin crunching down these 300 images using Adobe... Read More
When reading an article where some term is used often,... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
SyncUp, a file synchronizer is designed to assist the home... Read More
Microsoft Business Solutions Great Plains was historically designed to serve... Read More
I love new technology. I am still ready to wait... Read More
We will base our prognosis on our Microsoft Business Solutions... Read More
If you copy something from a Web site or elsewhere...... Read More
If there still are few unprotected computers left, I haven't... Read More
In our opinion, traditional approach when you select ERP/MRP system... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
Anti-virus software is used to find, remove or fix files... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
I like my software simple. If it's too complex or... Read More
Breese limo service at o'hare ..If you have Microsoft Great Plains as main accounting and... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
I've been active in the Cisco Certification track for four... Read More
While paper labeling CDs and DVDs may appear to be... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Upgrading. Downtime. Maintenance. Hardware obsolescence. Implementation issues. The litany of... Read More
How do you run a program on a remote server... Read More
Once a business idea is selected, it is highly recommended... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
Viruses and spyware usually show up on your computer one... Read More
Every day millions of new web documents emerge on the... Read More
Following tips help you to learn a software in lesser... Read More
Microsoft Great Plains serves majority of US based horizontal and... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
XML Server can be a Web Server that stores the... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
MicroWorld Technologies, Inc. the leading solutions provider in the area... Read More
Each Industry and market niche has business specific and unique... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
Ok... Where to start?Well, I guess I will start at... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
Imagine something that follows you home and sets itself up... Read More
How would you like to prevent spyware and adware from... Read More
Microsoft Business Solutions Navision is main ERP application for European,... Read More
Software |