473,386 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

SQL Datatype

Hi
im using SQL2000 in my query should contain column name date so i mention the datatype as datetime what's my doubt mean is any possible without displaying the time?Then is any possible to change the datatype range for int etc...other than nvarchar what's the datatype we will mention for phone no column.Advance thanks...
Dec 27 '07 #1
2 1278
JamieHowarth0
533 Expert 512MB
Hi Darshini,

With datetime, as far as I am aware (especially when using Microsoft SQL Server) you are able to select the format of data to be stored, similar to Microsoft Access - long, medium or short date etc. - but you are not able to remove the functionality of the field to hold time information.

For nvarchar (or int) fields storing telephone numbers, use nvarchar. You cannot get an int field to store a leading 0 which most countries employ for dialling internally (certainly here in the UK they do), the system would automatically trim off any leading zero (although you could compensate for this programatically but I wouldn't like to try it). Safest bet - stick to nvarchar.

I also moved your thread as this is an SQL Server-related question, not an ASP one. Please use the appropriate forum in future.

Best regards,

medicineworker
Dec 27 '07 #2
ck9663
2,878 Expert 2GB
if you want not display the time part of your datetime field, whether it's smalldatetime or datetime, you have to handle that on your front-end, not on the back-end.

i agree with medicineworker, you have to use nvarchar. i saw some phone numbers with access code (usually "0" or "011" ) + area code (could sometimes go up to 4-digit) + the 7 digit phone number. that's an 11 (or 13) -digit integer. and, yes, you will loose the access code. that's trillion (comes after billion, right?). you might not be able to sequentially populate it, since there are no phone numbers that starts with "0", but you have still to accommodate the full size of the number.

-- CK
Dec 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Sanjay Minni | last post by:
What is the datatype to be used for Primary Key columns for most optimised access given that - There will be a single column primary key only - The values will only be integers (but as...
1
by: thepercival | last post by:
Hello, I have a stored procedure and the return data type is number(16) as you can see. but I get it back in the code as a var_numeric and then the precision depends on the value of the...
8
by: Eternally | last post by:
Hi folks, I've got a program which has a function which uses templates to accept parameters of any type. Works well, but there's one certain datatype which I want to special case and do an...
0
by: SoYouKnowBrig | last post by:
Hi All, I am using Microsoft.ApplicationBlocks.Cache.CacheManager to persist a System.Data.Dataset object. This Dataset object has a DataTable that is created from an existing DataTable using...
10
by: andrewcw | last post by:
I read in a earlier post that I can get the column of a grid to sort by datetime if the column type was set as Date I deserialize my XML and one attribute of the XSD has type as dateTime but upon...
3
by: Sri | last post by:
In VB, to know the field type of a column stored in a recordset the command I use is If rsQuery.Fields(k).Type = adCurrency Then How will I achieve the same in ASP.net. I could not find a...
1
by: Bryan | last post by:
I have a class called "Prop". I want that class to have a property called "DataType" where the user can select and store a datatype. How can I store a DataType value in a class property. how...
4
by: Orchid | last post by:
How can I change a Date datatype to a Number datatype? For example, I want a date 10/31/2006 to show 1031 as Number datatype. But I don't want it becomes 39021. What formula should I use? ...
0
by: graju80 | last post by:
I am kind of new to Db2... Question: What are the rules that DB2 uses to determine the right datatype for a particular column for on-the-fly SQL generation? For example...
11
by: BD | last post by:
Hi, all. I'm running 8.2 on Windows. This is a development platform for a project whose production environment is running on a mainframe. I believe that the RI compilation process is not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.