473,404 Members | 2,213 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,404 software developers and data experts.

Finding values containing milli seconds!


Hi all...

I've got a group of tables and I wanted to first see which tables
contained a fields containing the "Date/Time" data type. And I was
successful in doing so...here's the query:
(
select a.name tablename, b.name colname
from sysobjects a, syscolumns b
where a.name = object_name(b.id)
AND B.TYPE = 61 AND A.XTYPE = 'U'

)
Now...my only issue is find which query I can run (On each table)
which returns to me ONLY the values containing the date/time stamp
with milli seconds (Ex: 01/01/2007 10:10:50:987)

I require this since we are planning on shifting those tables to the
Oracle platform, and we've had issues doing this while loading the
extracted information, since it was not taking the values containing
the "milliseconds".

Is there a way to do this? Or is it better to simply remove the
milliseconds all togeather? I wouldn't mind doing so provided that it
doesn't includes changes to the actual data type.

May 23 '07 #1
1 1643
Mohd Al Junaibi (mo***************@gmail.com) writes:
I require this since we are planning on shifting those tables to the
Oracle platform, and we've had issues doing this while loading the
extracted information, since it was not taking the values containing
the "milliseconds".
SELECT datetimecol
FROM tbl
WHERE datepart(ms, datetimecol) <0
Is there a way to do this? Or is it better to simply remove the
milliseconds all togeather? I wouldn't mind doing so provided that it
doesn't includes changes to the actual data type.
UPDATE tbl
SET datetimecol = dateadd(ms, -datepart(ms, datetimecol), datetimecol)
WHERE datepart(ms, datetimecol) <0

Caveat: I did not test this.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 23 '07 #2

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

Similar topics

14
by: Antoni | last post by:
Hello, I wondered if anyone could offer some guidance over my php script. I was hoping the example would allow the user to click the submit buttons and the item number increment. And when the...
11
by: srkkreddy | last post by:
Hi, I have written a large program which makes multiple calls to number of functions (also written by me) of the program. Now, I want to know the collective time taken by all the calls to a...
2
by: ElkGroveR | last post by:
Hi there! I'm using PHP to create a simple, dynamic MySQL SELECT query. The user chooses a selection from a HTML Form SELECT element's many options and submits the form via a POST action. ...
11
by: Bob | last post by:
Hello, I am not a js programmer, but i was hoping to find a prewritten script that i may be able to use. all i need is a simple count up timer that has a start, pause, and stop control to it, i...
17
by: binjobster | last post by:
Hello everyone, I'm updating some documents that describes so many C/C++ functions/method(about 2500). But I'm not familiar with these codes. So I want to find such a utility can generate...
14
by: prasadjoshi124 | last post by:
Hi All, I am writing a small tool which is supposed to fill the filesystem to a specified percent. For, that I need to read how much the file system is full in percent, like the output given...
4
by: Manikandan | last post by:
Hi, I'm inserting a datetime values into sql server 2000 from c# SQL server table details Table name:date_test columnname datatype No int date_t DateTime ...
7
by: Nick | last post by:
Hi there, I have a website that functions fine locally, but when published to the server it develops a bottleneck during loading some of the pages. Basically what happens is the page loads to...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.