473,386 Members | 1,785 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.

cast from datetime type to smalldatetime type?

Hi,
How can I cast from datetime type to smalldatetime type.
I get the records from a table which has got a datetime type column but I
want to display it smalldatetime format.
Thanks,
Salim
Nov 17 '05 #1
2 5914
Stu
I think you can use something like:

response.write(dMyLongDate.tostring("dd/MM/yy"))

Regards,

Stu
"Salim Afþar" <sa****@luckyeye.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,
How can I cast from datetime type to smalldatetime type.
I get the records from a table which has got a datetime type column but I
want to display it smalldatetime format.
Thanks,
Salim

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.505 / Virus Database: 302 - Release Date: 30/07/2003
Nov 17 '05 #2
Not like that:
I get it with sql string.I want to do something like that :

select format(mydate,("dd/MM/yy"),.... from myTable

Thanks a lot

"Stu" <st****@ntpcl.uk.com> wrote in message
news:u2**************@TK2MSFTNGP10.phx.gbl...
I think you can use something like:

response.write(dMyLongDate.tostring("dd/MM/yy"))

Regards,

Stu
"Salim Afþar" <sa****@luckyeye.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,
How can I cast from datetime type to smalldatetime type.
I get the records from a table which has got a datetime type column but I want to display it smalldatetime format.
Thanks,
Salim

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.505 / Virus Database: 302 - Release Date: 30/07/2003

Nov 17 '05 #3

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

Similar topics

2
by: JTWhaler | last post by:
I'm looking for an efficient t-sql script to loop through all user tables in a db and determine/print the value of each row having a datetime field (including cases where there are multiple...
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...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
7
by: TheLostLeaf | last post by:
DateTime tTime = DateTime.Now; ------------------------------------------------------------------------------------------- tTime returns "1:59:00 PM" it never returns seconds. Database field...
6
by: Manikandan | last post by:
Hi, I need to insert the datetime with milliseconds value into a datarow. My code as below DataTable testDataTable=new DataTable(); testDataTable.Columns.Add("updatedDateTime",...
2
by: justin | last post by:
Hello all: I have a FormView that has it's DataSourceID set to a SqlDataSource that uses stored procedures for it's select, update, insert, and delete. I want the FormView to have an "autosave"...
2
by: Thomas609 | last post by:
Hi, I want to update a column typed datetime. My statement is: update 'tablename' set Datum_Ende = '2007-12-17 08:49:04.000' where 'columnID_name' = 23250 and 'columndate_Name' =...
11
by: =?Utf-8?B?UGFvbG8=?= | last post by:
I have a SQL database table with rows in which the primary key is a DateTime type (although I don't use the Time part). Have added numerous rows and now want to delete one so I enter the date...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
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
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.