472,328 Members | 1,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Convert nvarchar to smalldatetime

How do I convert an nvarchar field to smalldatetime format?

My nvarcharfield (saledatetext) is in the format YYYY-MM-DD.

I want to convert is to smalldatetime (field: saledate)

Thanks for the help

*** Sent via Developersdex http://www.developersdex.com ***
Jul 22 '05 #1
1 5481
CONVERT(DATETIME, saledatetext, 120)

Note that the third parameter (which indicates date format) is not strictly
necessary when using yyyy-mm-dd, but it is when using formats that can be
ambiguous.
-Mark

"Joey Martin" <jo**@infosmiths.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How do I convert an nvarchar field to smalldatetime format?

My nvarcharfield (saledatetext) is in the format YYYY-MM-DD.

I want to convert is to smalldatetime (field: saledate)

Thanks for the help

*** Sent via Developersdex http://www.developersdex.com ***

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE...
2
by: Joey Martin | last post by:
Please help. I have a ms sql table called data. Two fields, saledate(smalldatetime),saledatetext(nvarchar) I have dates (ex. 05/04/05) in the...
5
by: Cally | last post by:
Hello, I would like to convert a field from ntext field found in one database table to float field found in another database table. The reason...
2
by: Jelena via SQLMonster.com | last post by:
Does anybody can help me to convert datetime value let's '1936-04-13 07:00:00.000' to DATE as '04/13/1936'. I need this value in the Excell as a...
2
by: Learner | last post by:
Hello, I am trying to store the data entered in a webform in the database. I have few Int and one SmallDateTime filed in my table in SQL Server...
0
by: Wes Peters | last post by:
I have a situation where I want to filter records for a given day. The field that stores the date/time uses the date() function as a default value,...
1
by: Wes Peters | last post by:
I have a situation where I want to filter records for a given day. The field that stores the date/time uses the date() function as a default value,...
2
by: sallyme | last post by:
Hi I am passing Date value form .asp form like "3/15/2007" And i am geting error Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)...
4
dcharnigo
by: dcharnigo | last post by:
I am converting a varchar(10) field to a smalldatetime in a stored procedure but have run into a problem. Some of the rows contain an invalid date....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.