Here is my scenario:
I'm creating a thin client viewer/editor for a client that has a rebate
program.
There are several types of rebate programs, and incentives are different for
each. There are approximately 160 predicating companies and each "reports"
it's sales amount or other qualifying criteria each quarter.
Now, all this is pretty vanilla until, except that the rebate percentage for
each company can change in midstream of a fiscal year.
The old records (pre percentage) change must be kept for viewing only, but
post change must be editable and updateable.
What is the best way to accomplish this without having to nest a lot of
tables?
Thanks in advance for you input..
~ChrisI'd track the old and new percentage rates in a table and based on your
query date (Run from date) you select the proper percentage rate from
that table to use for the calculation.
Ex.
PercentageValidDate Percentage
1/1/2000 6.5
1/1/2003 6.85
6/1/2003 6.93
SELECT TOP 11 Percentage where PercentageValidDATE < [paramater run date]
order by PercentageValidDATE DESC
Smitty wrote:
> Here is my scenario:
> I'm creating a thin client viewer/editor for a client that has a rebate
> program.
> There are several types of rebate programs, and incentives are different for
> each. There are approximately 160 predicating companies and each "reports"
> it's sales amount or other qualifying criteria each quarter.
> Now, all this is pretty vanilla until, except that the rebate percentage for
> each company can change in midstream of a fiscal year.
> The old records (pre percentage) change must be kept for viewing only, but
> post change must be editable and updateable.
> What is the best way to accomplish this without having to nest a lot of
> tables?
> Thanks in advance for you input..
> ~Chris
>
Showing posts with label editor. Show all posts
Showing posts with label editor. Show all posts
Sunday, February 19, 2012
Friday, February 17, 2012
Design Query in Editor (SSMS)
In Enterprise Manager(EM): click a table then open table in Query mode. A
user can drag and drop tables from different databases. Once a user connects
a common ID the tool will automatically create the JOINS for you.
Question--
In SSMS: 'Design Query in Editor' (Ctl+Shift+Q) does not allow a user to do
the same functionality described in the EM above. Is there a certain way to
do this besides typing it the query window?Open the Query Designer (Click on the "New Query" button).
On the toolbar just over the frame you use to write your queries, you find
these buttons (from let to right):
-Connect
-Disconnect,
-Change Connection
-Combo to select the Database to be used
-Execute
-Check syntax
-stop execution
-Display Estimated query Plan
-Analyze query in Database Engine Tuning Advisor
-DESIGN QUERY IN EDITOR (the button with the classic symbol for Microsoft
design mode...)
-...etc, etc.
Have a good job
Gilberto Zampatti
"morphius" wrote:
> In Enterprise Manager(EM): click a table then open table in Query mode. A
> user can drag and drop tables from different databases. Once a user connects
> a common ID the tool will automatically create the JOINS for you.
> Question--
> In SSMS: 'Design Query in Editor' (Ctl+Shift+Q) does not allow a user to do
> the same functionality described in the EM above. Is there a certain way to
> do this besides typing it the query window?|||But the DESIGN QUERY IN EDITOR ( the classic symbol for Microsoft
> design mode...) does not allow a user to do the functionality described below?
"Gilberto Zampatti" wrote:
> Open the Query Designer (Click on the "New Query" button).
> On the toolbar just over the frame you use to write your queries, you find
> these buttons (from let to right):
> -Connect
> -Disconnect,
> -Change Connection
> -Combo to select the Database to be used
> -Execute
> -Check syntax
> -stop execution
> -Display Estimated query Plan
> -Analyze query in Database Engine Tuning Advisor
> -DESIGN QUERY IN EDITOR (the button with the classic symbol for Microsoft
> design mode...)
> -...etc, etc.
> Have a good job
> Gilberto Zampatti
> "morphius" wrote:
> > In Enterprise Manager(EM): click a table then open table in Query mode. A
> > user can drag and drop tables from different databases. Once a user connects
> > a common ID the tool will automatically create the JOINS for you.
> >
> > Question--
> > In SSMS: 'Design Query in Editor' (Ctl+Shift+Q) does not allow a user to do
> > the same functionality described in the EM above. Is there a certain way to
> > do this besides typing it the query window?|||The behavior will be slightly different, but - for example - if you drag two
tables and connect two fields (with or without the same name), the designer
proposes automaticllay an INNER JOIN.
What do you need exactly?
Gilberto Zampatti
"morphius" wrote:
> But the DESIGN QUERY IN EDITOR ( the classic symbol for Microsoft
> > design mode...) does not allow a user to do the functionality described below?
>
> "Gilberto Zampatti" wrote:
> > Open the Query Designer (Click on the "New Query" button).
> > On the toolbar just over the frame you use to write your queries, you find
> > these buttons (from let to right):
> > -Connect
> > -Disconnect,
> > -Change Connection
> > -Combo to select the Database to be used
> > -Execute
> > -Check syntax
> > -stop execution
> > -Display Estimated query Plan
> > -Analyze query in Database Engine Tuning Advisor
> > -DESIGN QUERY IN EDITOR (the button with the classic symbol for Microsoft
> > design mode...)
> > -...etc, etc.
> > Have a good job
> > Gilberto Zampatti
> > "morphius" wrote:
> >
> > > In Enterprise Manager(EM): click a table then open table in Query mode. A
> > > user can drag and drop tables from different databases. Once a user connects
> > > a common ID the tool will automatically create the JOINS for you.
> > >
> > > Question--
> > > In SSMS: 'Design Query in Editor' (Ctl+Shift+Q) does not allow a user to do
> > > the same functionality described in the EM above. Is there a certain way to
> > > do this besides typing it the query window?
user can drag and drop tables from different databases. Once a user connects
a common ID the tool will automatically create the JOINS for you.
Question--
In SSMS: 'Design Query in Editor' (Ctl+Shift+Q) does not allow a user to do
the same functionality described in the EM above. Is there a certain way to
do this besides typing it the query window?Open the Query Designer (Click on the "New Query" button).
On the toolbar just over the frame you use to write your queries, you find
these buttons (from let to right):
-Connect
-Disconnect,
-Change Connection
-Combo to select the Database to be used
-Execute
-Check syntax
-stop execution
-Display Estimated query Plan
-Analyze query in Database Engine Tuning Advisor
-DESIGN QUERY IN EDITOR (the button with the classic symbol for Microsoft
design mode...)
-...etc, etc.
Have a good job
Gilberto Zampatti
"morphius" wrote:
> In Enterprise Manager(EM): click a table then open table in Query mode. A
> user can drag and drop tables from different databases. Once a user connects
> a common ID the tool will automatically create the JOINS for you.
> Question--
> In SSMS: 'Design Query in Editor' (Ctl+Shift+Q) does not allow a user to do
> the same functionality described in the EM above. Is there a certain way to
> do this besides typing it the query window?|||But the DESIGN QUERY IN EDITOR ( the classic symbol for Microsoft
> design mode...) does not allow a user to do the functionality described below?
"Gilberto Zampatti" wrote:
> Open the Query Designer (Click on the "New Query" button).
> On the toolbar just over the frame you use to write your queries, you find
> these buttons (from let to right):
> -Connect
> -Disconnect,
> -Change Connection
> -Combo to select the Database to be used
> -Execute
> -Check syntax
> -stop execution
> -Display Estimated query Plan
> -Analyze query in Database Engine Tuning Advisor
> -DESIGN QUERY IN EDITOR (the button with the classic symbol for Microsoft
> design mode...)
> -...etc, etc.
> Have a good job
> Gilberto Zampatti
> "morphius" wrote:
> > In Enterprise Manager(EM): click a table then open table in Query mode. A
> > user can drag and drop tables from different databases. Once a user connects
> > a common ID the tool will automatically create the JOINS for you.
> >
> > Question--
> > In SSMS: 'Design Query in Editor' (Ctl+Shift+Q) does not allow a user to do
> > the same functionality described in the EM above. Is there a certain way to
> > do this besides typing it the query window?|||The behavior will be slightly different, but - for example - if you drag two
tables and connect two fields (with or without the same name), the designer
proposes automaticllay an INNER JOIN.
What do you need exactly?
Gilberto Zampatti
"morphius" wrote:
> But the DESIGN QUERY IN EDITOR ( the classic symbol for Microsoft
> > design mode...) does not allow a user to do the functionality described below?
>
> "Gilberto Zampatti" wrote:
> > Open the Query Designer (Click on the "New Query" button).
> > On the toolbar just over the frame you use to write your queries, you find
> > these buttons (from let to right):
> > -Connect
> > -Disconnect,
> > -Change Connection
> > -Combo to select the Database to be used
> > -Execute
> > -Check syntax
> > -stop execution
> > -Display Estimated query Plan
> > -Analyze query in Database Engine Tuning Advisor
> > -DESIGN QUERY IN EDITOR (the button with the classic symbol for Microsoft
> > design mode...)
> > -...etc, etc.
> > Have a good job
> > Gilberto Zampatti
> > "morphius" wrote:
> >
> > > In Enterprise Manager(EM): click a table then open table in Query mode. A
> > > user can drag and drop tables from different databases. Once a user connects
> > > a common ID the tool will automatically create the JOINS for you.
> > >
> > > Question--
> > > In SSMS: 'Design Query in Editor' (Ctl+Shift+Q) does not allow a user to do
> > > the same functionality described in the EM above. Is there a certain way to
> > > do this besides typing it the query window?
Subscribe to:
Posts (Atom)