Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Add Formula for a column
I'm trying to add a formula to a column in a Table, in Enterprise Manager,
but I'm not being allowed.

I want a column to be multiplication of two other columns, datatypes money
and decimal.

I'm typing SubTotal * TaxRate ....

What's the big deal with this?



Report this thread to moderator Post Follow-up to this message
Old Post
Calvin
04-29-05 08:23 AM


RE: Add Formula for a column
Hi Calvin
As per my knowledge you cannot add  formula to the table. You can do this in
your query.

If u feel you use the formula frequently, u can create a VIEW of UDF

Hope this will solve your problem.

Thanks and regards
Chandra


"Calvin" wrote:

> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
> but I'm not being allowed.
>
> I want a column to be multiplication of two other columns, datatypes money
> and decimal.
>
> I'm typing SubTotal * TaxRate ....
>
> What's the big deal with this?
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Chandra
04-29-05 08:23 AM


Re: Add Formula for a column
Try using Query Analyzer and execute the CREATE TABLE statement instead, the
n you can post an error
message for us. Below work fine on my machine:

CREATE TABLE #t
(subtotal decimal(5,3)
,taxrate int
,x AS subtotal*taxrate)

An alternative is to present derived information in views instead of in the 
table...

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/


"Calvin" <calvin@discussions.microsoft.com> wrote in message
news:BE975F7D. 1622%calvin@discussi
ons.microsoft.com...
> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
> but I'm not being allowed.
>
> I want a column to be multiplication of two other columns, datatypes money
> and decimal.
>
> I'm typing SubTotal * TaxRate ....
>
> What's the big deal with this?
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Tibor Karaszi
04-29-05 08:23 AM


Re: Add Formula for a column
Yeah... realized that would save the hassle after my post. Thanks for your
reply.


On 29/4/05 7:06 am, in article
5042C552-DDBF-4D63-BE77- C8B6ECDAF946@microso
ft.com, "Chandra"
<Chandra@discussions.microsoft.com> wrote:

> Hi Calvin
> As per my knowledge you cannot add  formula to the table. You can do this 
in
> your query.
>
> If u feel you use the formula frequently, u can create a VIEW of UDF
>
> Hope this will solve your problem.
>
> Thanks and regards
> Chandra
>
>
> "Calvin" wrote:
> 


Report this thread to moderator Post Follow-up to this message
Old Post
Calvin
04-29-05 02:23 PM


Re: Add Formula for a column
Decided to change the query which updates the table instead, but thanks fr
your reply.


On 29/4/05 9:19 am, in article O6qYcQJTFHA.3056@TK2MSFTNGP14.phx.gbl, "Tibor
Karaszi" <tibor_please.no. email_karaszi@hotmai
l.nomail.com> wrote:

> Try using Query Analyzer and execute the CREATE TABLE statement instead, t
hen
> you can post an error
> message for us. Below work fine on my machine:
>
> CREATE TABLE #t
> (subtotal decimal(5,3)
> ,taxrate int
> ,x AS subtotal*taxrate)
>
> An alternative is to present derived information in views instead of in th
e
> table...


Report this thread to moderator Post Follow-up to this message
Old Post
Calvin
04-29-05 02:23 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 11:42 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006