Wrox Programmer Forums
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 18th, 2003, 12:51 AM
Registered User
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default datatype


I discover a new thing.
In Microsoft Access,the datatype Currency is available to choose.However in SQL Server 2000,we can only choose money.

Is it possible to do it in SQL Server 2000 for the datatype involve price, i mean money?

Another problem, if in my database, in the price column,i keep all my products's price, let say as RM100.00.
so, in my web page then, i hope to see the product price also RM100.00.
So, how should i design my database now, i mean the datatype for the price .

Old November 18th, 2003, 09:55 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts

The SQL Server 2000 data type you should use to store monetry values (e.g. price) is money. This is roughly equivalent to Access's Currency data type. You can store monetry values with a precision of (I think) 4 decimal places using the SQL Server money data type. All you will need to do to display this value on your web page (or any client application for that matter) is read the value and add the money sign (e.g. €, RM, £, $, etc.) to the front of it.
Response.Write "RM" & YourRecordset("YourMoneyField")
I hope this answers your questions.

Owain Williams

Similar Threads
Thread Thread Starter Forum Replies Last Post
datatype umeshtheone SQL Server 2000 2 May 16th, 2007 11:56 AM
SQL Datatype rain_uk SQL Server ASP 2 July 5th, 2005 01:34 AM
DataType Validation Baby_programmer ASP.NET 1.0 and 1.1 Basics 0 October 30th, 2004 08:00 PM
DataType Conversion using WHERE IN ( ) Colonel Angus SQL Language 3 August 18th, 2004 07:43 AM
How Could I use C APIs with different DataType?? 6cet6 VS.NET 2002/2003 0 March 24th, 2004 09:20 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.