473,382 Members | 1,375 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,382 software developers and data experts.

datetime field in SQL Server 2005

I m using SQL Server 2005 databse. There is a datetime field in table. I m fetching data from there but I want to display only date not time. How can I remove time?

I am fetching it by this line:

CAST(databasename.V_sdt.saledt AS varchar(30))

so how can I modify it to remove time?

thks
Mar 21 '08 #1
3 1376
ck9663
2,878 Expert 2GB
I m using SQL Server 2005 databse. There is a datetime field in table. I m fetching data from there but I want to display only date not time. How can I remove time?

I am fetching it by this line:

CAST(databasename.V_sdt.saledt AS varchar(30))

so how can I modify it to remove time?

thks

use the style argument in CONVERT function.

-- CK
Mar 21 '08 #2
thks for reply.
Can you please tell me by applying it to my code or by sample?
What is the difference between CAST and CONVERT?
thks
Mar 21 '08 #3
ck9663
2,878 Expert 2GB
Check it here

-- CK
Mar 21 '08 #4

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

Similar topics

16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
1
by: anagai | last post by:
I have a datetime field that records date and time. This field records when rec is created. I also have a timestamp field that records whenever the record is updated. I noticed that when i first...
1
by: colinhumber | last post by:
I have a datetime variable coming from my ASP.NET application that has a time portion. I give my users the option to perform an equals, greater than, less than, or between comparison. The trouble...
5
by: ns21 | last post by:
Our application is windows desktop application. We are using VS.Net 2003, C#, Framework 1.1, SQL 2000. We use webservices to add/update/select objects. We are using XML Serialization. Following is...
4
by: luckyabhishek | last post by:
Hi I am using a java webservice in a .NET application. The xml type of a field in this webservice is xsd:datetime. When i call the webservice from the application i get a deserialization error on...
1
by: smileydip | last post by:
Hi Guys, Could some help me.... I am trying to use the below specified two field from "SysJobHistory" table from "MSDB". Field name "run_date" and "run_time". Both this fields are of INT data...
2
by: vikram.mankar | last post by:
I'm running into a constant issue of SQL Server modifying the millisecond part of a timestamp insert from another application. The application inserts timestamp which includes a millisecond portion...
7
by: =?Utf-8?B?UGVuIEp1YW4=?= | last post by:
How to define databinding for 'datetime' data type ? ( Xxx = '<%# Bind("Datetime") %>' ) Thank you. Pen
3
by: =?ISO-8859-2?Q?W=B3adys=B3aw_Bodzek?= | last post by:
Hi, I want to change 2 default behaviors of ms-sql server within a connection. 1. All varchar (etc.) fields should be returned as UTF-8. I know about field attribute collation and convert...
7
by: gr8Ashish | last post by:
Hi all, I am facing a problem. I create a application that is insert date and time in SQL Server 2005 table from web page then i fetch this datetime type field in vb.net application and adding some...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.