|
-
May 16th, 2007, 08:28 AM
#1
Thread Starter
Fanatic Member
SQL Time Issue
Hey there,
i've just noticed a big problem in my SQL table.
inside the table we have the following fields:
tbl_Arrivals
iId - int identity eg: 1
dArrivalDate - smalldatetime eg: 01/01/2007
sArrivalSchdeduledTime - nvarchar(5) eg: 23:35
sArrivalActualTime - nvarchar(5) eg: 00:15
I have to do a report in my table to establish the length of mins each arrival was late.
so basically sArrivalActualTime - sArrivalSchdeduledTime
which i was doing using the following SQL
DATEDIFF(mi, CAST(sArrivalActualTime AS DateTime),
CAST(sArrivalSchdeduledTime AS DateTime))
now this works fine when the time doesn't go past 23:59.
but for the example data above it will cause serious issues.
has anyone come across a solution to this before.
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|