473,769 Members | 5,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.i d)
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 "millisecon ds".

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 1663
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 "millisecon ds".
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****@sommarsk og.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
3151
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 user clicks, the my basket icon the items.php scripts starts and the variables from the current script are passed to this. I tried to display the variables as the items are incremented, though
11
3255
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 specific function. Is there any way I can find this time. Thanks in advance, Raja Kiran Sandireddy.
2
2851
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. The SELECT query is built as follows: $itemtype = stripslashes(trim($_POST));
11
1453
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 have found some, but they all seem to reset once you pause them, and i need it to stay where it is at and then continue from the paused point once someone hits restart. if anyone knows where i can find something like this i would appreciate
17
2040
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 returning value list from the codes. Is it possible? Or is it hard to write one? Thanks.
14
2816
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 by df -k lopgod10:~/mycrfile # df -k /mnt/mvdg1/vset Filesystem 1K-blocks Used Available Use% Mounted on
4
5594
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 C# coding
7
2760
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 about 25% then it freezes for anything from 10 - 40 seconds, before suddenly loading the rest of the page. Of course I understand that this could be down to some code on the page locking the thread or suchlike, but I would like to be able to be...
275
12381
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
10214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.