Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Sunday, March 11, 2012

Database Anomaly

Hi

I have a table call Employee, and got a field name call Employee Name

Employee Name

--, --

%%%,

(Gpsi) Dr Ac, Baruah

(Gpsi) Dr Ap, Dhital

0, 0

1 To 1, Centre

ABAYOMI, EMJ

4, US

5F4MBL01, 5F4MBL01

5Jxths01, 5Jxths01

A&E Dept(Rochdale, Zts)

NULL

ABAYASIRIWARDA, JM

Shaw, A

NULL

Zzzzzzzzzzzzzz, Aaaaaaaaaaaa

From this example data, I need to get only bolded records only, rest of the records are garbage records.

Eg: garbage Records like: “A&E Dept(Rochdale, Zts) “ has got a ‘&’ sign is not a valid employee name

“1 To 1, Centre” has got a ‘1’ is not a valid employee name

“%%%,” has got a ‘%’ sign is not a valid employee name

what is the best way to identify only valid emplyee names ?

Please help me to solve this problem

Sujithf

Sujithf:

Here is my first pass at this; I have quite a few questions:

-- --
-- Issues:
-- (1) What non alphabetic characters besides comma are allowed?
-- (2) I have assumed that a name must be formatted "lastName, firstName"
-- to be legal. Therefore, the name "Madonna" is filtered out.
-- (3) I am allowing the single quote, hyphen, period and comma characters
-- and all alphabetics. How does this list need to change?
-- (4) I set the "repeating letter" threshold at 3 repeated letters being
-- invalid.
-- (5) I put in a special condition for the 3 repeated letters condition
-- to allow "Fred Flintstone III" to pass. If this is not valid
-- this special condition test can be eliminated.
-- (6) If Roman numerals as part of the name aren't valid a test for this
-- will need to be put together.
-- (7) I have assumed that the name "Katie O'Neal" is valid.
-- (8) I have assumed that the name "Mike De La Hoz" is valid.
-- (9) I have assumed that the name [Jimmy "The Z" De Zego] is not valid.
-- --
set nocount on

declare @.names table
( employeeName varchar (30)
)
insert into @.names values ('- -, - -')
insert into @.names values ('%%%')
insert into @.names values ('(Gpsi) Dr Ac, Baruah')
insert into @.names values ('(Gpsi) Dr Ap, Dhital')
insert into @.names values ('0, 0')
insert into @.names values ('1 to 1, Centre')
insert into @.names values ('4, US')
insert into @.names values ('Abayomi, EMJ')
insert into @.names values ('5F4MBL01, 5F4MBL01')
insert into @.names values ('5Jxths01, 5Jxths01')
insert into @.names values (null)
insert into @.names values ('Abayasiriwarda, JM')
insert into @.names values (null)
insert into @.names values ('Shaw, A')
insert into @.names values ('Zzzzzzzzzzzzz, Aaaaaaaaaaaaa')
insert into @.names values ('A&E Dept(Rochdale, Zts)')

insert into @.names values ('Madonna')
insert into @.names values ('Thant, U')
insert into @.names values ('U, Betcha')
insert into @.names values ('U, U')
insert into @.names values ('Flintstone, Fred Jr')
insert into @.names values ('Flintstone, Fred III')
insert into @.names values ('Flintstone, Fred VVV')
insert into @.names values ('O''Neal, Katie')
insert into @.names values ('De La Hoz, Mike')
insert into @.names values ('Aardvark, Jimmy')
insert into @.names values ('Taylor-Curry, Ann')
insert into @.names values ('De Zego, Jimmy "The Z"')
insert into @.names values ('Suds, Dog &')
insert into @.names values ('Auto, Big 4')
insert into @.names values ('This, i''s, a-bad, name.')
--select * from @.names

select employeeName
from @.names
where employeeName like '[abcdefghijklmnopqrstuvwxyz]%, [abcdefghijklmnopqrstuvwxyz]%'
and employeeName not like '%[^abcdefghijklmnopqrstuvwxyz, ''-.]%'
and len (employeeName) = len (replace (employeeName, ',', '')) + 1
and employeeName not like '%aaa%'
and employeeName not like '%bbb%'
and employeeName not like '%ccc%'
and employeeName not like '%ddd%'
and employeeName not like '%eee%'
and employeeName not like '%fff%'
and employeeName not like '%ggg%'
and employeeName not like '%hhh%'
and employeeName not like '%iiii%'
and employeeName not like '%jjj%'
and employeeName not like '%kkk%'
and employeeName not like '%lll%'
and employeeName not like '%mmm%'
and employeeName not like '%nnn%'
and employeeName not like '%ooo%'
and employeeName not like '%ppp%'
and employeeName not like '%qqq%'
and employeeName not like '%rrr%'
and employeeName not like '%sss%'
and employeeName not like '%ttt%'
and employeeName not like '%uuu%'
and employeeName not like '%vvv%'
and employeeName not like '%www%'
and employeeName not like '%xxx%'
and employeeName not like '%yyy%'
and employeeName not like '%zzz%'


-- Sample Output:

-- employeeName
--
-- Abayomi, EMJ
-- Abayasiriwarda, JM
-- Shaw, A
-- Thant, U
-- U, Betcha
-- U, U
-- Flintstone, Fred Jr
-- Flintstone, Fred III
-- O'Neal, Katie
-- De La Hoz, Mike
-- Aardvark, Jimmy
-- Taylor-Curry, Ann

Wednesday, March 7, 2012

DataAdd narrowing conversion error

I am simply trying to take a date and add the value from another field
to it using the following expression:
=dateadd("d", " & Fields!new_tgddatefrom.Value & ",
Parameters!HolidayDate.Value)
new_tgddatefrom.Value is an int data type
HolidayDate.Value is a date
The expression works fine if I use an acutal number for the value to
add but when I use the field.value I get an error:
Overload resoution failed because no accessible 'DateAdd can be called
without a narrowing conversion.
Why or why is it so difficult to work with dates!?!? If anyone can
help me get this working I would sincerely appreciate it!
DebraTry =dateadd("d", Fields!new_tgddatefrom.Value, Parameters!HolidayDate.Value)
"Debralous" wrote:
> I am simply trying to take a date and add the value from another field
> to it using the following expression:
> =dateadd("d", " & Fields!new_tgddatefrom.Value & ",
> Parameters!HolidayDate.Value)
> new_tgddatefrom.Value is an int data type
> HolidayDate.Value is a date
>
> The expression works fine if I use an acutal number for the value to
> add but when I use the field.value I get an error:
> Overload resoution failed because no accessible 'DateAdd can be called
> without a narrowing conversion.
> Why or why is it so difficult to work with dates!?!? If anyone can
> help me get this working I would sincerely appreciate it!
> Debra
>|||William wrote:
> Try =dateadd("d", Fields!new_tgddatefrom.Value, Parameters!HolidayDate.Value)
>
That was the first thing I tried. While it doesn't error, it doesn't
actually add the number of days in Fields!new_tgddatefrom.Value, it
just shows the date which is in Parameters!HolidayDate.Value.
Any other suggestions?|||This is the proper function call:
= DateAdd(interval, number, date)
Are you sure you have valid datatypes and values for your parameters?
If the function is used in a report with multiple datasets or groupings, do
you need to declare a different scope for your function variables?
"Debralous" wrote:
> William wrote:
> > Try =dateadd("d", Fields!new_tgddatefrom.Value, Parameters!HolidayDate.Value)
> >
> That was the first thing I tried. While it doesn't error, it doesn't
> actually add the number of days in Fields!new_tgddatefrom.Value, it
> just shows the date which is in Parameters!HolidayDate.Value.
> Any other suggestions?
>

Friday, February 24, 2012

data types in SQL Server

I'm new to SQL Server, but could someone explain how to set up a field with an auto number/increment that can be used within an Access DB?Go to Books OnLine. Lookup IDENTITY. Read. Create DDL. Try it, you'll like it :) .|||Do you have SQL Server Client Tools Installed?

Do you know what Books Online is?

How about Enterprise Manager or Query Analyzer?

Do you know what DDL is?|||In reply to your questions:

Yes :)
No :confused:
Yes :)
No :confused:

I've found all that and read about it but that's what I've already done. What I wanted to do was set up a system in Access using forms etc but link the tables to SQL Server instead.
Usually when you create the tables in Access and set up an autonumber field, create a form, run it, when you change part of the form it automatically displays the number when you add a record, I take it when doing it through SQL Server it doesn't do that?|||First, I recommend that you create and Access Data Project rather than an Access MDB with linked tables, if you have not already taken this route.

Second, why are you displaying the auto-generated ID on your form anyway? Identity values are surrogate keys, and on principle should not be exposed to the users.

Third, create your auto-incrementing ID value in your table using Enterprise Manager. The identity value is not assigned, however, until the record is saved, so it will not be able to display it on your form until the transaction is committed.

data types help?

Which data type do I need to assign to my field to let users enter characters such as +=-_|\ etc...pretty much every single character from a standard keyboard...
thanksAny of the CHAR() related types, such as CHAR(), VARCHAR(), NCHAR(), NVARCHAR(), or TEXT should do nicely.

-PatP|||I have varchar now (on a web site with sql server as a database) but only save the letter and number for this example ab+ not the plus...

But I do have function, that I will probably have to customize,that is causing it only to save letters and numbers,

Thanks for your help once again

Data types error!Please help!

I am developing on SQL server and Crystal Report environment as usual. But I realize today during a new report development that there is a field called Accountingdate that reside in my SQL server with data type datetime which is in View1 appears as datatype number when I opened it in Crystal Report. Is there any reason behind these?

Summarized

In SQL Server I can view it as date time(4/24/2006) but in Crystal Report is number(38738) and the data in it i s totally differentwhat is the datatpye in table? Is it Datetime?
format that to have the format you want|||Data type that I want is datetime exactly what I want. But the data type that appeared is int and data in it is also different|||Right click on the field. Go to Format section and format it mm/dd/yyyy or whichever format you want

Data Types

Hi...what would be the right data type to use for a field that will hold a
long description that will be keyed in by the user?
Currently, I have it set to use varchar with a size of 3000, but it still
cuts off.
Thanks> Currently, I have it set to use varchar with a size of 3000, but it still
> cuts off.
What does that mean? You are trying to store more than 3,000 characters, or
your stored procedure truncates the entry, or Query Analyzer doesn't show
the full entry, or something else ... ?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Hi,
SQL 2000 allows varchar with a max size of 8000. You can use ALTER TABLE
statement to increase the width from 3000 to 8000.
If your problem is just display then try selecting the data with out grid
(text format) option in query analyzer.
Thanks
Hari
MCDBA
"SQL" <nospam@.asdfadsf.com> wrote in message
news:uN9gJH06DHA.2656@.TK2MSFTNGP11.phx.gbl...
> Hi...what would be the right data type to use for a field that will hold a
> long description that will be keyed in by the user?
> Currently, I have it set to use varchar with a size of 3000, but it still
> cuts off.
> Thanks
>|||Assuming this isn't a display issue and you consider this, be careful
,since inserts will then fail when the total length of a row exceeds
8060 bytes. Better to cut the information off than to create a
situation where inserts can cause an error condition. You could also
look into using the text data type. It's not as easy to manipulate
beyond inserts and retrieval, but can hold up to 2 Gig of information,
since it only stores a 16-byte text pointer in the row. If you can,
limit the amount of information inserted at the front end.
If it is a display issue, you will not only need to change the output to
text from grid, but you will also have to go into the Query Analyzer
Tools|Options|[Results] and set the "Maximum Characters per Column:"
value to match or exceed your varchar column length. The default is
256, I believe.
SK
Hari wrote:
>Hi,
>SQL 2000 allows varchar with a max size of 8000. You can use ALTER TABLE
>statement to increase the width from 3000 to 8000.
>
>If your problem is just display then try selecting the data with out grid
>(text format) option in query analyzer.
>Thanks
>Hari
>MCDBA
>"SQL" <nospam@.asdfadsf.com> wrote in message
>news:uN9gJH06DHA.2656@.TK2MSFTNGP11.phx.gbl...
>
>>Hi...what would be the right data type to use for a field that will hold a
>>long description that will be keyed in by the user?
>>Currently, I have it set to use varchar with a size of 3000, but it still
>>cuts off.
>>Thanks
>>
>>
>
>

data types

What is the best data type to use within SQL server in a field for
storing currency?

Regards,
CiarnOn 10 Mar 2005 06:17:03 -0800, chudson007@.hotmail.com wrote:

>What is the best data type to use within SQL server in a field for
>storing currency?

Hi Ciarn,

DECIMAL(??,2), with ?? denoting the total number of digits (including
the cents). So if the maximum value is 5 million, you use DECIMAL(11,2).

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||(chudson007@.hotmail.com) writes:
> What is the best data type to use within SQL server in a field for
> storing currency?

Hm, what do you mean with "currency"? If you mean amounts, a decimal(n, 2)
as Hugo suggested can be a good idea. Note, though, that for some reason
the money data type has four decimals.

If you are talking about currency prices, such as how many USD you need
by one 1 EUR, then you need many decimals. Usually currency prices go
with six decimals, but often you also need the reverse, and if you
store with six decimals only, the inverted price will suffer a rounding
error. So I would recommend floats in this case.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Data Types

Hi...what would be the right data type to use for a field that will hold a
long description that will be keyed in by the user?
Currently, I have it set to use varchar with a size of 3000, but it still
cuts off.
Thanks> Currently, I have it set to use varchar with a size of 3000, but it still
quote:

> cuts off.

What does that mean? You are trying to store more than 3,000 characters, or
your stored procedure truncates the entry, or Query Analyzer doesn't show
the full entry, or something else ... ?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Hi,
SQL 2000 allows varchar with a max size of 8000. You can use ALTER TABLE
statement to increase the width from 3000 to 8000.
If your problem is just display then try selecting the data with out grid
(text format) option in query analyzer.
Thanks
Hari
MCDBA
"SQL" <nospam@.asdfadsf.com> wrote in message
news:uN9gJH06DHA.2656@.TK2MSFTNGP11.phx.gbl...
quote:

> Hi...what would be the right data type to use for a field that will hold a
> long description that will be keyed in by the user?
> Currently, I have it set to use varchar with a size of 3000, but it still
> cuts off.
> Thanks
>
|||Assuming this isn't a display issue and you consider this, be careful
,since inserts will then fail when the total length of a row exceeds
8060 bytes. Better to cut the information off than to create a
situation where inserts can cause an error condition. You could also
look into using the text data type. It's not as easy to manipulate
beyond inserts and retrieval, but can hold up to 2 Gig of information,
since it only stores a 16-byte text pointer in the row. If you can,
limit the amount of information inserted at the front end.
If it is a display issue, you will not only need to change the output to
text from grid, but you will also have to go into the Query Analyzer
Tools|Options|[Results] and set the "Maximum Characters per Column:"
value to match or exceed your varchar column length. The default is
256, I believe.
SK
Hari wrote:
quote:

>Hi,
>SQL 2000 allows varchar with a max size of 8000. You can use ALTER TABLE
>statement to increase the width from 3000 to 8000.
>
>If your problem is just display then try selecting the data with out grid
>(text format) option in query analyzer.
>Thanks
>Hari
>MCDBA
>"SQL" <nospam@.asdfadsf.com> wrote in message
>news:uN9gJH06DHA.2656@.TK2MSFTNGP11.phx.gbl...
>
>
>

Data type: Text vs VarChar (10000)

I have a table that is used to archive communications.
One of the fields is ComText, I've used the "Text" data type for this field.
Now my question is if I use a varchar data type with the length of (10000) would it improve performance in any way (specialy for reporting purposes)?The maximum row size is less than 8k. Plus, it is not good to have a very long varchar field, the space usage will be poor.|||Thanks for your reply.
Do you have experience regarding this issue and an Access front end, cause it seems to me that access reports have some trobule printing reports with memo fields, specially when the machine has a low RAM.

Sunday, February 19, 2012

Data Type Range

Hi,

When I set a tinyint field as identity, it automatically sets the identity seed as 1. I wonder whether the increment is set to go around in loop. Say, I have the range of 256 numbers for a tinybit. So, an identifier should go from 1 to 255 and then to 0 and then back to 1. Is that right?

Not quite.

Once the limit is reached...crash

An identity column creates a constraint that does not allow duplicates and also an index to remember the last number generated.

Use int not tinyint and drop the field and recreate it if you need to.

Adamus

|||

As Adam alluded, an error will occur WHEN there is an attempt to add a 256th row to the table (since the tinyint ranges from 0 to 255, and the IDENTITY column started at 1).

This code will help demonstrate the consequences:

Code Snippet

SET NOCOUNT ON

DECLARE @.MyTable table
( RowId tinyint IDENTITY,
Name varchar(20)
)

DECLARE @.Counter int

SET @.Counter = 1

WHILE @.Counter <= 260

BEGIN
PRINT @.Counter
INSERT INTO @.MyTable VALUES ( @.Counter )
SET @.Counter = ( @.Counter + 1 )
END

|||Thanks

Data Type Question

i have a table with an integer field that is of type PositiveInt_Type with a
length of 4. I am having a problem where when alarger integer tries to get
stored (let's say 125,000), it shows up in the database as 99,999.
What datatype and length should I be using for an integer that could be up
to 1,000,000 in length?
Thanks
JoeThe max value allowed in an integer column is 2^31 - 1 (2,147,483,647). See
"Data Types" in BOL.
AMB
"Joe Williams" wrote:

> i have a table with an integer field that is of type PositiveInt_Type with
a
> length of 4. I am having a problem where when alarger integer tries to ge
t
> stored (let's say 125,000), it shows up in the database as 99,999.
> What datatype and length should I be using for an integer that could be up
> to 1,000,000 in length?
> Thanks
> Joe
>
>|||Try a MySQL newsgroup for MySQL questions. You will have more chance of a
quick and correct answer. This is a newsgroup dedicated to Microsoft SQL
Server.
Jacco Schalkwijk
SQL Server MVP
"Joe Williams" <joe@.anywhere.com> wrote in message
news:eFgaSy6BFHA.1260@.TK2MSFTNGP12.phx.gbl...
>i have a table with an integer field that is of type PositiveInt_Type with
>a length of 4. I am having a problem where when alarger integer tries to
>get stored (let's say 125,000), it shows up in the database as 99,999.
> What datatype and length should I be using for an integer that could be up
> to 1,000,000 in length?
> Thanks
> Joe
>|||This is Microsoft SQL Server - SQL 2000
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:udIW156BFHA.2568@.TK2MSFTNGP11.phx.gbl...
> Try a MySQL newsgroup for MySQL questions. You will have more chance of a
> quick and correct answer. This is a newsgroup dedicated to Microsoft SQL
> Server.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Joe Williams" <joe@.anywhere.com> wrote in message
> news:eFgaSy6BFHA.1260@.TK2MSFTNGP12.phx.gbl...
>|||On Mon, 31 Jan 2005 11:08:53 -0500, Joe Williams wrote:

>This is Microsoft SQL Server - SQL 2000
Hi Joe,
In that case, try rephrasing your question. Your original question is:
MS SQL Server 2000 doesn't support a datatype PositiveInt_Type.
MS SQL Server will also never (as far as I know - and that's pretty far)
truncate an overflowed value down to the maximum - if you attempt to store
a value outside of the numerical range, you'll get a runtime (arithmetic
overflow) error.
As Alejandro already pointed out: int holds values from -2,147,483,648
through 2,147,483,647.
More details can be found in Books Online.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hugo (and all),
Thanks for the response. I guess now I am wondering about what is going on,
as I have Micorosft SQL 2000 Server and one of my valid choices in
Enterprise Manager for a data type is PoitiveInt_Type.
If SQL doesn't support, why is it there? And how did it get there?
I also have some other strange type:
PositiveReal_Type
ParmNo_Type
NormalTime_Type
What's the deal? Thanks
Joe
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:96osv01p0ts5pb34grrbn9bdrtpv8pn035@.
4ax.com...
> On Mon, 31 Jan 2005 11:08:53 -0500, Joe Williams wrote:
>
> Hi Joe,
> In that case, try rephrasing your question. Your original question is:
>
> MS SQL Server 2000 doesn't support a datatype PositiveInt_Type.
>
> MS SQL Server will also never (as far as I know - and that's pretty far)
> truncate an overflowed value down to the maximum - if you attempt to store
> a value outside of the numerical range, you'll get a runtime (arithmetic
> overflow) error.
>
> As Alejandro already pointed out: int holds values from -2,147,483,648
> through 2,147,483,647.
> More details can be found in Books Online.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||Nope, the issue is not with SQL Server 2000. PositiveInt_Type is not a
native datatype in SQL Server 2000.
Do you use any third party software which uses the PositiveInt_Type data
type?
(Storing the maximum value allowed when the value that is inserted is
greater than the maximum value allowed (i.e. store 99,999 instead of
125,000) is one of those nice "features" of MySQL. That's why I thought that
it was MySQL at first, but apparently there are more systems out there where
data integrity doesn't matter.
Jacco Schalkwijk
SQL Server MVP
"Joe Williams" <joe@.anywhere.com> wrote in message
news:upKOl76BFHA.1296@.TK2MSFTNGP10.phx.gbl...
> This is Microsoft SQL Server - SQL 2000
>
> "Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid>
> wrote in message news:udIW156BFHA.2568@.TK2MSFTNGP11.phx.gbl...
>|||Those are User Defined Data Types. You can find the definitions in
Enterprise Manager under the folder User Defined Data Types under your
database folder.
Jacco Schalkwijk
SQL Server MVP
"Joe Williams" <joe@.anywhere.com> wrote in message
news:%23oTv9W7BFHA.608@.TK2MSFTNGP15.phx.gbl...
> Hugo (and all),
> Thanks for the response. I guess now I am wondering about what is going
> on, as I have Micorosft SQL 2000 Server and one of my valid choices in
> Enterprise Manager for a data type is PoitiveInt_Type.
> If SQL doesn't support, why is it there? And how did it get there?
> I also have some other strange type:
> PositiveReal_Type
> ParmNo_Type
> NormalTime_Type
> What's the deal? Thanks
> Joe
>
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:96osv01p0ts5pb34grrbn9bdrtpv8pn035@.
4ax.com...
>|||These must be user-defined datatypes (UDT). See Books Online, sp_addtype. An
UDT is basically an
alias name for a built-in datatype, and there might be an UDT formed in EM w
here you can see the
base datatype for each UDT.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Joe Williams" <joe@.anywhere.com> wrote in message news:%23oTv9W7BFHA.608@.TK2MSFTNGP15.phx.
gbl...
> Hugo (and all),
> Thanks for the response. I guess now I am wondering about what is going on
, as I have Micorosft
> SQL 2000 Server and one of my valid choices in Enterprise Manager for a da
ta type is
> PoitiveInt_Type.
> If SQL doesn't support, why is it there? And how did it get there?
> I also have some other strange type:
> PositiveReal_Type
> ParmNo_Type
> NormalTime_Type
> What's the deal? Thanks
> Joe
>
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:96osv01p0ts5pb34grrbn9bdrtpv8pn035@.
4ax.com...
>|||Sounds like you have a few User Defined Data Types. In Enterprise Manager
under the database you are working in check the User Defined Data Types
folder. Also check BOL for details of course.
Perhaps you inherited a SQL database that was developed by a fromer MySQL
developer?
Paul
"Joe Williams" wrote:

> Hugo (and all),
> Thanks for the response. I guess now I am wondering about what is going on
,
> as I have Micorosft SQL 2000 Server and one of my valid choices in
> Enterprise Manager for a data type is PoitiveInt_Type.
> If SQL doesn't support, why is it there? And how did it get there?
> I also have some other strange type:
> PositiveReal_Type
> ParmNo_Type
> NormalTime_Type
> What's the deal? Thanks
> Joe
>
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:96osv01p0ts5pb34grrbn9bdrtpv8pn035@.
4ax.com...
>
>

data type nvarchar(MAX) in SQL Server 2005

nvarchar(max)

I have a nvarchar(MAX) “Description” field in my SQL Server 2005 database. Somewhere I think I read that nvarchar(MAX) is the size of 4000.

My question is in my Insert Stored Proc

setANSI_NULLSON

setQUOTED_IDENTIFIERON

GO

ALTERPROCEDURE [dbo].[syl_CodeScheduleTypeInsert]

@.ScheduleName nvarchar(50),

@.ScheduleDescription nvarchar(????)

AS

BEGIN

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SETNOCOUNTON;

BEGINTRY

INSERTI

What number should replace the ???? with? nvarchar(4000) is that correct?

I tried nvarchar(MAX) and nvarchar but both versions only input one character into my database table.

Please help a newbie out, cheers!

No NVarchar (max) is more than 4000 because it can grow to 2 gig so the ?? can be replaced with any thing between 4000 and 2gig. There are restriction using this data type like no Order By and some other clauses because it is bigger than one SQL Server page which is NVarchar 4000. Try the links below for details. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms186939.aspx

http://msdn2.microsoft.com/en-us/library/ms187752.aspx

|||

newbie06:

I tried nvarchar(MAX) and nvarchar but both versions only input one character into my database table.

This sounds strange. How did you use the @.ScheduleDescription nvarchar(max) parameter in your stored procedure?

Data type for "Comments" field?

Hi,

I am using SQL Server 2005 Express. I am creating a table, which will have a comments field. Whats an appropriate data type that should be used for a "comments" field? So far, I have unlimited text and characters can be entered, but that a limitation can be placed.

Thanks

Chirs

Most likely, you will be best served with varchar(max).

Varchar(max) will hold up to 2 GB of data.

Friday, February 17, 2012

Data Type Convertion Error

Hello,
I need to convert one character field to datetime and after make the
differenc between two fields.
The problem is that if in the output result appears one value that is
biggest then 23:59:59 hours its shown the
following error:
(xxxxxxx row(s) affected)
Server: Msg 242, Level 16, state 3, line 1
The convertion of a char data type to a datetime data type resulted in an
out-of-range datetime value
Example:
select convert(datetime, field, 108) from table_name
or
select convert (datetime, '24:00:00', 108) from table_name
(xxxxxxx row(s) affected)
Server: Msg 242, Level 16, state 3, line 1
The convertion of a char data type to a datetime data type resulted in an
out-of-range datetime value
I need to use all the results and know the difference between them in hour
or minutes.
Example:
select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
field_B, 108))
from table_name
Can you help me?
Thanks and best regards
Hi
24:00:00 is not a valid time. In effect, it is 00:00:00.000 the next day.
00:00:00.000 to 23:59:59.999 is
You need to fix your data to a ISO valid date value.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:CD38A959-9022-4BA9-80B6-1AFCDE0AD8FB@.microsoft.com...
> Hello,
> I need to convert one character field to datetime and after make the
> differenc between two fields.
> The problem is that if in the output result appears one value that is
> biggest then 23:59:59 hours its shown the
> following error:
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> Example:
> select convert(datetime, field, 108) from table_name
> or
> select convert (datetime, '24:00:00', 108) from table_name
>
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> I need to use all the results and know the difference between them in hour
> or minutes.
> Example:
> select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
> field_B, 108))
> from table_name
> Can you help me?
> Thanks and best regards
|||try...
select datediff(mi,
dateadd(ss,cast(substring(field1,1,2) as
int)*60*60+cast(substring(field1,4,2) as int)*60+ cast(substring(field1,7,2)
as int),cast(0 as datetime)),
dateadd(ss,cast(substring(field2,1,2) as
int)*60*60+cast(substring(field2,4,2) as int)*60+ cast(substring(field2,7,2)
as int),cast(0 as datetime))
)
-- example
select datediff(mi,
dateadd(ss,cast(substring('34:15:10',1,2) as
int)*60*60+cast(substring('34:15:10',4,2) as int)*60+
cast(substring('34:15:10',7,2) as int),cast(0 as datetime)),
dateadd(ss,cast(substring('24:18:10',1,2) as
int)*60*60+cast(substring('24:18:10',4,2) as int)*60+
cast(substring('24:18:10',7,2) as int),cast(0 as datetime))
)
"CC&JM" wrote:

> Hello,
> I need to convert one character field to datetime and after make the
> differenc between two fields.
> The problem is that if in the output result appears one value that is
> biggest then 23:59:59 hours its shown the
> following error:
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> Example:
> select convert(datetime, field, 108) from table_name
> or
> select convert (datetime, '24:00:00', 108) from table_name
>
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> I need to use all the results and know the difference between them in hour
> or minutes.
> Example:
> select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
> field_B, 108))
> from table_name
> Can you help me?
> Thanks and best regards
|||Thanks everybody.
Best regards
"Aleksandar Grbic" wrote:
[vbcol=seagreen]
> try...
> select datediff(mi,
> dateadd(ss,cast(substring(field1,1,2) as
> int)*60*60+cast(substring(field1,4,2) as int)*60+ cast(substring(field1,7,2)
> as int),cast(0 as datetime)),
> dateadd(ss,cast(substring(field2,1,2) as
> int)*60*60+cast(substring(field2,4,2) as int)*60+ cast(substring(field2,7,2)
> as int),cast(0 as datetime))
> )
>
>
> -- example
> select datediff(mi,
> dateadd(ss,cast(substring('34:15:10',1,2) as
> int)*60*60+cast(substring('34:15:10',4,2) as int)*60+
> cast(substring('34:15:10',7,2) as int),cast(0 as datetime)),
> dateadd(ss,cast(substring('24:18:10',1,2) as
> int)*60*60+cast(substring('24:18:10',4,2) as int)*60+
> cast(substring('24:18:10',7,2) as int),cast(0 as datetime))
> )
>
>
> "CC&JM" wrote:

Data Type Convertion Error

Hello,
I need to convert one character field to datetime and after make the
differenc between two fields.
The problem is that if in the output result appears one value that is
biggest then 23:59:59 hours its shown the
following error:
(xxxxxxx row(s) affected)
Server: Msg 242, Level 16, state 3, line 1
The convertion of a char data type to a datetime data type resulted in an
out-of-range datetime value
Example:
select convert(datetime, field, 108) from table_name
or
select convert (datetime, '24:00:00', 108) from table_name
(xxxxxxx row(s) affected)
Server: Msg 242, Level 16, state 3, line 1
The convertion of a char data type to a datetime data type resulted in an
out-of-range datetime value
I need to use all the results and know the difference between them in hour
or minutes.
Example:
select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
field_B, 108))
from table_name
Can you help me?
Thanks and best regardsHi
24:00:00 is not a valid time. In effect, it is 00:00:00.000 the next day.
00:00:00.000 to 23:59:59.999 is
You need to fix your data to a ISO valid date value.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:CD38A959-9022-4BA9-80B6-1AFCDE0AD8FB@.microsoft.com...
> Hello,
> I need to convert one character field to datetime and after make the
> differenc between two fields.
> The problem is that if in the output result appears one value that is
> biggest then 23:59:59 hours its shown the
> following error:
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> Example:
> select convert(datetime, field, 108) from table_name
> or
> select convert (datetime, '24:00:00', 108) from table_name
>
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> I need to use all the results and know the difference between them in hour
> or minutes.
> Example:
> select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
> field_B, 108))
> from table_name
> Can you help me?
> Thanks and best regards|||try...
select datediff(mi,
dateadd(ss,cast(substring(field1,1,2) as
int)*60*60+cast(substring(field1,4,2) as int)*60+ cast(substring(field1,7,2)
as int),cast(0 as datetime)),
dateadd(ss,cast(substring(field2,1,2) as
int)*60*60+cast(substring(field2,4,2) as int)*60+ cast(substring(field2,7,2)
as int),cast(0 as datetime))
)
-- example
select datediff(mi,
dateadd(ss,cast(substring('34:15:10',1,2
) as
int)*60*60+cast(substring('34:15:10',4,2
) as int)*60+
cast(substring('34:15:10',7,2) as int),cast(0 as datetime)),
dateadd(ss,cast(substring('24:18:10',1,2
) as
int)*60*60+cast(substring('24:18:10',4,2
) as int)*60+
cast(substring('24:18:10',7,2) as int),cast(0 as datetime))
)
"CC&JM" wrote:

> Hello,
> I need to convert one character field to datetime and after make the
> differenc between two fields.
> The problem is that if in the output result appears one value that is
> biggest then 23:59:59 hours its shown the
> following error:
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> Example:
> select convert(datetime, field, 108) from table_name
> or
> select convert (datetime, '24:00:00', 108) from table_name
>
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> I need to use all the results and know the difference between them in hour
> or minutes.
> Example:
> select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
> field_B, 108))
> from table_name
> Can you help me?
> Thanks and best regards|||Thanks everybody.
Best regards
"Aleksandar Grbic" wrote:
[vbcol=seagreen]
> try...
> select datediff(mi,
> dateadd(ss,cast(substring(field1,1,2) as
> int)*60*60+cast(substring(field1,4,2) as int)*60+ cast(substring(field1,7,
2)
> as int),cast(0 as datetime)),
> dateadd(ss,cast(substring(field2,1,2) as
> int)*60*60+cast(substring(field2,4,2) as int)*60+ cast(substring(field2,7,
2)
> as int),cast(0 as datetime))
> )
>
>
> -- example
> select datediff(mi,
> dateadd(ss,cast(substring('34:15:10',1,2
) as
> int)*60*60+cast(substring('34:15:10',4,2
) as int)*60+
> cast(substring('34:15:10',7,2) as int),cast(0 as datetime)),
> dateadd(ss,cast(substring('24:18:10',1,2
) as
> int)*60*60+cast(substring('24:18:10',4,2
) as int)*60+
> cast(substring('24:18:10',7,2) as int),cast(0 as datetime))
> )
>
>
> "CC&JM" wrote:
>

Data Type Convertion Error

Hello,
I need to convert one character field to datetime and after make the
differenc between two fields.
The problem is that if in the output result appears one value that is
biggest then 23:59:59 hours its shown the
following error:
(xxxxxxx row(s) affected)
Server: Msg 242, Level 16, state 3, line 1
The convertion of a char data type to a datetime data type resulted in an
out-of-range datetime value
Example:
select convert(datetime, field, 108) from table_name
or
select convert (datetime, '24:00:00', 108) from table_name
(xxxxxxx row(s) affected)
Server: Msg 242, Level 16, state 3, line 1
The convertion of a char data type to a datetime data type resulted in an
out-of-range datetime value
I need to use all the results and know the difference between them in hour
or minutes.
Example:
select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
field_B, 108))
from table_name
Can you help me?
Thanks and best regardsHi
24:00:00 is not a valid time. In effect, it is 00:00:00.000 the next day.
00:00:00.000 to 23:59:59.999 is
You need to fix your data to a ISO valid date value.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:CD38A959-9022-4BA9-80B6-1AFCDE0AD8FB@.microsoft.com...
> Hello,
> I need to convert one character field to datetime and after make the
> differenc between two fields.
> The problem is that if in the output result appears one value that is
> biggest then 23:59:59 hours its shown the
> following error:
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> Example:
> select convert(datetime, field, 108) from table_name
> or
> select convert (datetime, '24:00:00', 108) from table_name
>
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> I need to use all the results and know the difference between them in hour
> or minutes.
> Example:
> select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
> field_B, 108))
> from table_name
> Can you help me?
> Thanks and best regards|||try...
select datediff(mi,
dateadd(ss,cast(substring(field1,1,2) as
int)*60*60+cast(substring(field1,4,2) as int)*60+ cast(substring(field1,7,2)
as int),cast(0 as datetime)),
dateadd(ss,cast(substring(field2,1,2) as
int)*60*60+cast(substring(field2,4,2) as int)*60+ cast(substring(field2,7,2)
as int),cast(0 as datetime))
)
-- example
select datediff(mi,
dateadd(ss,cast(substring('34:15:10',1,2) as
int)*60*60+cast(substring('34:15:10',4,2) as int)*60+
cast(substring('34:15:10',7,2) as int),cast(0 as datetime)),
dateadd(ss,cast(substring('24:18:10',1,2) as
int)*60*60+cast(substring('24:18:10',4,2) as int)*60+
cast(substring('24:18:10',7,2) as int),cast(0 as datetime))
)
"CC&JM" wrote:
> Hello,
> I need to convert one character field to datetime and after make the
> differenc between two fields.
> The problem is that if in the output result appears one value that is
> biggest then 23:59:59 hours its shown the
> following error:
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> Example:
> select convert(datetime, field, 108) from table_name
> or
> select convert (datetime, '24:00:00', 108) from table_name
>
> (xxxxxxx row(s) affected)
> Server: Msg 242, Level 16, state 3, line 1
> The convertion of a char data type to a datetime data type resulted in an
> out-of-range datetime value
> I need to use all the results and know the difference between them in hour
> or minutes.
> Example:
> select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
> field_B, 108))
> from table_name
> Can you help me?
> Thanks and best regards|||Thanks everybody.
Best regards
"Aleksandar Grbic" wrote:
> try...
> select datediff(mi,
> dateadd(ss,cast(substring(field1,1,2) as
> int)*60*60+cast(substring(field1,4,2) as int)*60+ cast(substring(field1,7,2)
> as int),cast(0 as datetime)),
> dateadd(ss,cast(substring(field2,1,2) as
> int)*60*60+cast(substring(field2,4,2) as int)*60+ cast(substring(field2,7,2)
> as int),cast(0 as datetime))
> )
>
>
> -- example
> select datediff(mi,
> dateadd(ss,cast(substring('34:15:10',1,2) as
> int)*60*60+cast(substring('34:15:10',4,2) as int)*60+
> cast(substring('34:15:10',7,2) as int),cast(0 as datetime)),
> dateadd(ss,cast(substring('24:18:10',1,2) as
> int)*60*60+cast(substring('24:18:10',4,2) as int)*60+
> cast(substring('24:18:10',7,2) as int),cast(0 as datetime))
> )
>
>
> "CC&JM" wrote:
> > Hello,
> >
> > I need to convert one character field to datetime and after make the
> > differenc between two fields.
> > The problem is that if in the output result appears one value that is
> > biggest then 23:59:59 hours its shown the
> > following error:
> >
> > (xxxxxxx row(s) affected)
> > Server: Msg 242, Level 16, state 3, line 1
> > The convertion of a char data type to a datetime data type resulted in an
> > out-of-range datetime value
> >
> > Example:
> >
> > select convert(datetime, field, 108) from table_name
> > or
> > select convert (datetime, '24:00:00', 108) from table_name
> >
> >
> > (xxxxxxx row(s) affected)
> > Server: Msg 242, Level 16, state 3, line 1
> > The convertion of a char data type to a datetime data type resulted in an
> > out-of-range datetime value
> >
> > I need to use all the results and know the difference between them in hour
> > or minutes.
> > Example:
> >
> > select datediff( hh, convert(datetime, field_A, 108), convert(datetime,
> > field_B, 108))
> > from table_name
> >
> > Can you help me?
> >
> > Thanks and best regards

Data type conversion issue

Hi guys
I exported some data from a text file to sql server. Here is the sample data..

This table has about 2 million rows.There is a date field in the table which comes as a 'nvarchar' in sql .When i try to convert it to a 'datetime' , i get an error as operation timed out..

Here is the data from the text file...

Date dispensed Outliers Formulation ID Provider Number (dispensing) NSS flag Patient category Units dispensed Total days supply
1/01/2006 12:00:00 a.m. normal 106509.00 7952 I A 120.00 30.00
1/01/2006 12:00:00 a.m. normal 106509.00 8208 I A 360.00 90.00
1/01/2006 12:00:00 a.m. normal 106509.00 9460 I A 120.00 30.00
1/01/2006 12:00:00 a.m. normal 106509.00 10184 I A 120.00 60.00
1/01/2006 12:00:00 a.m. normal 106509.00 10291 I A 120.00 60.00
1/01/2006 12:00:00 a.m. normal 106509.00 11149 I A 120.00 30.00
1/01/2006 12:00:00 a.m. normal 106509.00 11294 I A 120.00 60.00
1/01/2006 12:00:00 a.m. normal 106509.00 11777 I A 120.00 30.00
1/01/2006 12:00:00 a.m. normal 106509.00 12048 I A 120.00 30.00

I have tried the bulk insert as well.

Here is the script for the create table ..

USE [Library]

GO

/****** Object: Table [dbo].[tablename] Script Date: 10/03/2006 14:45:59 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[NormalOutlier1](

[Datedispensed] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,

[Outliers] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,

[Formulation ID] [float] NULL,

[Provider Number (dispensing)] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,

[NSS flag] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,

[Patient category] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,

[Units dispensed] [float] NULL,

[Total days supply] [float] NULL

) ON [PRIMARY]

Hope this helps

Did you try using a datetime rather than NVARCHAR(MAX) in the definition of the table ? There might be a implicit conversion possible for the values. if not you will have to convert the dates with your own logic using either an ETL process in DTS / SSIS or just by using a string manipulation.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Data type conversion .. Varchar to GUID

Hi,

I have a parameter @.name varchar(50)

but the table has a field with datatype GUID

how I can convert varchar to guid before insertion...

Thanks

As long as the format of the guid is correct, it should be no problem:

create table test
(
columnName uniqueidentifier
)
go
declare @.guid varchar(50) --char(36) would be better
set @.guid = 'E5F61BB0-38BA-4116-841D-C7E5AAA137A2'

insert into test
select @.guid
go

select *
from test

columnName

E5F61BB0-38BA-4116-841D-C7E5AAA137A2

declare @.guid varchar(50) --char(36) would be better
--invalid guid format:
set @.guid = 'E5F61BB038BA4116841DC7E5AAA137A2'

--failure
insert into test
select @.guid

Msg 8169, Level 16, State 2, Line 6
Conversion failed when converting from a character string to uniqueidentifier.

Data Type Confusion...

Which Datatype should i choose for Field "AGE"

Do i select "Int", "Char"?

SQL Server...in Table Desgin, The length for Int only can be max of 4 ?

Is this mean it can only store 4 digit ?

What if i want to store numbers but more then 4 digit ?

What will be the appropriate datatype to store numbers?For age, an appropriate data type would be 'int', you should however contemplate SmallDateTime if you need the full Date of Birth. An 'int' has a storage size of 4 bytes, hence 4, and can be of values from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).

Numbers can be stored using different data types, depending on what they represent and will be used for. E.g, for money, you simply use the data type 'money'.

Below are all numerics available on MS Sql Server 2000

EXACT NUMERICS
============
Integers
-------
bigint = Integer (whole number) data from -2^63 (-9223372036854775808) through 2^63-1 (9223372036854775807).

int = Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).

smallint = Integer data from 2^15 (-32,768) through 2^15 - 1 (32,767).

tinyint = Integer data from 0 through 255.
-------
bit
-------
bit = Integer data with either a 1 or 0 value.
-------
decimal and numeric
-------
decimal = Fixed precision and scale numeric data from -10^38 +1 through 10^38 –1.

numeric = Functionally equivalent to decimal.
-------
money and smallmoney
-------
money = Monetary data values from -2^63 (-922,337,203,685,477.5808) through 2^63 - 1 (+922,337,203,685,477.5807), with accuracy to a ten-thousandth of a monetary unit.

smallmoney = Monetary data values from -214,748.3648 through +214,748.3647, with accuracy to a ten-thousandth of a monetary unit.
-------
Approximate Numerics
-------
float = Floating precision number data from -1.79E + 308 through 1.79E + 308.

real = Floating precision number data from -3.40E + 38 through 3.40E + 38.|||Hie...

Thanks alot for the info...

I just realize the Length "4" for "int" doesn't meant the total number of 4 digit...?

But how bout the Datatype "Char" or "NvarChar", the length is the number of character is it?|||you can use tinyint for AGE|||:: you can use tinyint for AGE

If you do not expect the person to live longer than a century, yeah :-) .|||::But how bout the Datatype "Char" or "NvarChar", the length is the number of character is
::it?

This is documented in the - documentation, you know.

For char and varchar fields, this is indeed the number of chars you store / can store.

data type .... Q.....

I want to store amount data in a field. I am getting confused whether to use
Deciaml data type or Currency data type. I am not finding muh advantage in
using currency when compared to decimal data type. Any comments.
GaryDon't post the same question separately to multiple newsgroups. See my
answer in .programming.
SK
Gary Smith wrote:
quote:

>I want to store amount data in a field. I am getting confused whether to us
e
>Deciaml data type or Currency data type. I am not finding muh advantage in
>using currency when compared to decimal data type. Any comments.
>Gary
>
>