Nvarchar To Smalldatetime

I have a ms sql table called data. Two fields, saledate(smalldatetime),saledatetext(nvarchar). I have dates (ex. 05/04/05) in the saledatetext, but I need this converted into smalldatetime format and placed in the saledate column. Can you tell me how to do this using sql query analyzer?

View Replies


ADVERTISEMENT

SmallDateTime Column

I have an asp page which the user enters a time(e.g. 12:21). I need to insert this time into a SQL Server DB, which has a smalldatetime column.

I have tried everything I can think of (such as CDate, TimeValue, FormatDateTime etc) to convert the time string, into a valid time. However, the insert always try to insert a datetime datatype (e.g. 12/12/1899 12:21:00).

I am trying to process the insert through ado, eg:

objRS.AddNew
objRS("Field1") = strText
objRS("DateField") = dteValue
objRS.Update

View Replies View Related

Nvarchar Question

I have an asp page that updates a ms sql 2k db.

If put a name in a db field of 12 characters should the nvarchar length be
set to 24 to allow for double byte characters.

Should I be using nvarchar or char as when i make my input field length in
asp page 12 the insert fails but if i make it 3 or 4 it works ok even though
the db field length is set to same as asp field length.

View Replies View Related

Convert Nvarchar

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)

View Replies View Related

Nvarchar Field

I have an nvarchar field . These have entries like 2,3,2.5, etc. It's the decimals that get me. I want to be able to search for all listings with at least x bathrooms.

If I select all with at least 2 bathrooms, how can I get the ones with 2.5 to show. Is this possible or do I need to reconfigure the field type?

View Replies View Related

Field Type Nvarchar

i have a simple table with a field called "authors". this filed have a nvarchar(max) type (in MSSql 2005). i have a simple query "Select authors FROM table". in query analizer this return the value of authors, but when i run this in asp page, the field is empty.

in the code i have:

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, Conn, 1, 1

but rs("Authors") is empty.

If i change the type (and i use nvarchar(4000) for authors) there is no problem. for the connection i have Driver={SQL Native Client}.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved