Sunday, March 25, 2012
Difference between dates...
What I would like to achieve:
Calculate the amount of time spent on a job (JDEID) per day. For eg:
Assigned id 110 has worked 9 Hrs, 35 minutes on 02/01/2005, 8hrs on
03/01/2005 etc.
This is how my query started:
SELECT Tbl_JMS_Manhours.JDEID, Tbl_MS_Employees.Name,
Tbl_JMS_Manhours.DateTimeStart, Tbl_JMS_Manhours.DateTimeEnd, DATEDIFF(hh,
Tbl_JMS_Manhours.DateTimeStart,
Tbl_JMS_Manhours.DateTimeEnd) AS Diff
FROM Tbl_JMS_Manhours LEFT OUTER JOIN
Tbl_MS_Employees ON Tbl_JMS_Manhours.AssignedID = Tbl_MS_Employees.EmployeeID
WHERE (Tbl_JMS_Manhours.JDEID = @.JDEID)
Currently my query is showing me the difference only in hours, but I want to
know the hrs and minutes spent on a job. Then I don't remember how to only
show the date (31/01/2005). If I can convert my general date to a short
date, then I can seperate the days.
This is some current sample info: (AssignedID = An employee id which is
linked to a name)
ID JDEID AssignedID DateTimeStart DateTimeEnd
24 12345 114 31/01/2005 13:13 31/01/2005 13:20
40 157837 110 02/02/2005 07:00 02/02/2005 16:19
41 157837 110 02/02/2005 17:34 02/02/2005 18:19
42 157837 110 03/02/2005 07:00 03/02/2005 16:19
43 157837 110 04/02/2005 17:34 04/02/2005 18:19
In the end I wanna see it something like:
JDEID AssignedID Date Worked
157837 110 02/02/2005 7:35
157837 110 03/02/2005 8.15
Or something like that.
Please any help..
ThanksLook up the convert function in Books on Line to see all of the date
formatting possibilites..I don't understand how converting the date to a
short date is going to help...
What I would do is to get the difference in minutes, then do a little math
to convert that to hours and minutes...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Rudi Groenewald" <noone@.paflof.com> wrote in message
news:ctt85n$cpj$1@.ctb-nnrp2.saix.net...
> Hi All...
> What I would like to achieve:
> Calculate the amount of time spent on a job (JDEID) per day. For eg:
> Assigned id 110 has worked 9 Hrs, 35 minutes on 02/01/2005, 8hrs on
> 03/01/2005 etc.
> This is how my query started:
> SELECT Tbl_JMS_Manhours.JDEID, Tbl_MS_Employees.Name,
> Tbl_JMS_Manhours.DateTimeStart, Tbl_JMS_Manhours.DateTimeEnd, DATEDIFF(hh,
> Tbl_JMS_Manhours.DateTimeStart,
> Tbl_JMS_Manhours.DateTimeEnd) AS Diff
> FROM Tbl_JMS_Manhours LEFT OUTER JOIN
> Tbl_MS_Employees ON Tbl_JMS_Manhours.AssignedID => Tbl_MS_Employees.EmployeeID
> WHERE (Tbl_JMS_Manhours.JDEID = @.JDEID)
> Currently my query is showing me the difference only in hours, but I want
to
> know the hrs and minutes spent on a job. Then I don't remember how to
only
> show the date (31/01/2005). If I can convert my general date to a short
> date, then I can seperate the days.
> This is some current sample info: (AssignedID = An employee id which is
> linked to a name)
> ID JDEID AssignedID DateTimeStart DateTimeEnd
> 24 12345 114 31/01/2005 13:13 31/01/2005 13:20
> 40 157837 110 02/02/2005 07:00 02/02/2005 16:19
> 41 157837 110 02/02/2005 17:34 02/02/2005 18:19
> 42 157837 110 03/02/2005 07:00 03/02/2005 16:19
> 43 157837 110 04/02/2005 17:34 04/02/2005 18:19
>
> In the end I wanna see it something like:
> JDEID AssignedID Date Worked
> 157837 110 02/02/2005 7:35
> 157837 110 03/02/2005 8.15
>
> Or something like that.
> Please any help..
> Thanks
>|||convert function aint helpin much...
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:u59PnMfCFHA.2600@.TK2MSFTNGP09.phx.gbl...
> Look up the convert function in Books on Line to see all of the date
> formatting possibilites..I don't understand how converting the date to a
> short date is going to help...
> What I would do is to get the difference in minutes, then do a little math
> to convert that to hours and minutes...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Rudi Groenewald" <noone@.paflof.com> wrote in message
> news:ctt85n$cpj$1@.ctb-nnrp2.saix.net...
>> Hi All...
>> What I would like to achieve:
>> Calculate the amount of time spent on a job (JDEID) per day. For eg:
>> Assigned id 110 has worked 9 Hrs, 35 minutes on 02/01/2005, 8hrs on
>> 03/01/2005 etc.
>> This is how my query started:
>> SELECT Tbl_JMS_Manhours.JDEID, Tbl_MS_Employees.Name,
>> Tbl_JMS_Manhours.DateTimeStart, Tbl_JMS_Manhours.DateTimeEnd,
>> DATEDIFF(hh,
>> Tbl_JMS_Manhours.DateTimeStart,
>> Tbl_JMS_Manhours.DateTimeEnd) AS Diff
>> FROM Tbl_JMS_Manhours LEFT OUTER JOIN
>> Tbl_MS_Employees ON Tbl_JMS_Manhours.AssignedID =>> Tbl_MS_Employees.EmployeeID
>> WHERE (Tbl_JMS_Manhours.JDEID = @.JDEID)
>> Currently my query is showing me the difference only in hours, but I want
> to
>> know the hrs and minutes spent on a job. Then I don't remember how to
> only
>> show the date (31/01/2005). If I can convert my general date to a short
>> date, then I can seperate the days.
>> This is some current sample info: (AssignedID = An employee id which is
>> linked to a name)
>> ID JDEID AssignedID DateTimeStart DateTimeEnd
>> 24 12345 114 31/01/2005 13:13 31/01/2005 13:20
>> 40 157837 110 02/02/2005 07:00 02/02/2005 16:19
>> 41 157837 110 02/02/2005 17:34 02/02/2005 18:19
>> 42 157837 110 03/02/2005 07:00 03/02/2005 16:19
>> 43 157837 110 04/02/2005 17:34 04/02/2005 18:19
>>
>> In the end I wanna see it something like:
>> JDEID AssignedID Date Worked
>> 157837 110 02/02/2005 7:35
>> 157837 110 03/02/2005 8.15
>>
>> Or something like that.
>> Please any help..
>> Thanks
>>
>|||Try something like this:
SELECT Tbl_JMS_Manhours.JDEID, Tbl_MS_Employees.Name,
convert(varchar,Tbl_JMS_Manhours.DateTimeStart,101) as DateWorked,
DATEDIFF(hh, Tbl_JMS_Manhours.DateTimeStart, Tbl_JMS_Manhours.DateTimeEnd) +
':' +
datediff(mi, Tbl_JMS_Manhours.DateTimeStart, Tbl_JMS_Manhours.DateTimeEnd)
AS TimeWorked
FROM Tbl_JMS_Manhours LEFT OUTER JOIN
Tbl_MS_Employees ON Tbl_JMS_Manhours.AssignedID =Tbl_MS_Employees.EmployeeID
WHERE (Tbl_JMS_Manhours.JDEID = @.JDEID)
Vipul
"Rudi Groenewald" wrote:
> convert function aint helpin much...
>
>
> "Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
> news:u59PnMfCFHA.2600@.TK2MSFTNGP09.phx.gbl...
> > Look up the convert function in Books on Line to see all of the date
> > formatting possibilites..I don't understand how converting the date to a
> > short date is going to help...
> >
> > What I would do is to get the difference in minutes, then do a little math
> > to convert that to hours and minutes...
> >
> > --
> > Wayne Snyder, MCDBA, SQL Server MVP
> > Mariner, Charlotte, NC
> > www.mariner-usa.com
> > (Please respond only to the newsgroups.)
> >
> > I support the Professional Association of SQL Server (PASS) and it's
> > community of SQL Server professionals.
> > www.sqlpass.org
> >
> > "Rudi Groenewald" <noone@.paflof.com> wrote in message
> > news:ctt85n$cpj$1@.ctb-nnrp2.saix.net...
> >> Hi All...
> >>
> >> What I would like to achieve:
> >>
> >> Calculate the amount of time spent on a job (JDEID) per day. For eg:
> >> Assigned id 110 has worked 9 Hrs, 35 minutes on 02/01/2005, 8hrs on
> >> 03/01/2005 etc.
> >>
> >> This is how my query started:
> >>
> >> SELECT Tbl_JMS_Manhours.JDEID, Tbl_MS_Employees.Name,
> >> Tbl_JMS_Manhours.DateTimeStart, Tbl_JMS_Manhours.DateTimeEnd,
> >> DATEDIFF(hh,
> >> Tbl_JMS_Manhours.DateTimeStart,
> >> Tbl_JMS_Manhours.DateTimeEnd) AS Diff
> >> FROM Tbl_JMS_Manhours LEFT OUTER JOIN
> >> Tbl_MS_Employees ON Tbl_JMS_Manhours.AssignedID => >> Tbl_MS_Employees.EmployeeID
> >> WHERE (Tbl_JMS_Manhours.JDEID = @.JDEID)
> >>
> >> Currently my query is showing me the difference only in hours, but I want
> > to
> >> know the hrs and minutes spent on a job. Then I don't remember how to
> > only
> >> show the date (31/01/2005). If I can convert my general date to a short
> >> date, then I can seperate the days.
> >>
> >> This is some current sample info: (AssignedID = An employee id which is
> >> linked to a name)
> >> ID JDEID AssignedID DateTimeStart DateTimeEnd
> >> 24 12345 114 31/01/2005 13:13 31/01/2005 13:20
> >> 40 157837 110 02/02/2005 07:00 02/02/2005 16:19
> >> 41 157837 110 02/02/2005 17:34 02/02/2005 18:19
> >> 42 157837 110 03/02/2005 07:00 03/02/2005 16:19
> >> 43 157837 110 04/02/2005 17:34 04/02/2005 18:19
> >>
> >>
> >> In the end I wanna see it something like:
> >>
> >> JDEID AssignedID Date Worked
> >> 157837 110 02/02/2005 7:35
> >> 157837 110 03/02/2005 8.15
> >>
> >>
> >> Or something like that.
> >>
> >> Please any help..
> >>
> >> Thanks
> >>
> >>
> >
> >
>
>
Difference between dates in different rows...
Hi all,
I have a table named Orders and this table has two relevant fields: CustomerId and OrderDate. I am trying to construct a query that will give me the difference, in days, between each customer's order so that the results would be something like: (using Northwind as the example)
...
ALFKI 25/08/1997 03/10/1997 39
ALFKI 03/10/1997 13/10/1997 10
ALFKI 13/10/1997 15/01/1998 94
ALFKI 15/01/1998 16/03/1998 60
ALFKI 16/03/1998 09/04/1998 24
...
At the moment, I have the following query that I think is on the right track:
…
SELECT dbo.Orders.CustomerID, dbo.Orders.OrderDate AS LowDate, Orders_1.OrderDate AS HighDate, DATEDIFF([day], dbo.Orders.OrderDate, Orders_1.OrderDate) AS Difference FROM dbo.Orders INNER JOIN dbo.Orders Orders_1 ON dbo.Orders.CustomerID = Orders_1.CustomerID AND dbo.Orders.OrderDate < Orders_1.OrderDate GROUP BY dbo.Orders.CustomerID, dbo.Orders.OrderDate, Orders_1.OrderDate, DATEDIFF([day], dbo.Orders.OrderDate, Orders_1.OrderDate) ORDER BY dbo.Orders.CustomerID, dbo.Orders.OrderDate, Orders_1.OrderDate
…
However, this gives me too much data:
…
ALFKI 25/08/1997 03/10/1997 39
ALFKI 25/08/1997 13/10/1997 49
ALFKI 25/08/1997 15/01/1998 143
ALFKI 25/08/1997 16/03/1998 203
ALFKI 25/08/1997 09/04/1998 227
ALFKI 03/10/1997 13/10/1997 10
ALFKI 03/10/1997 15/01/1998 104
ALFKI 03/10/1997 16/03/1998 164
ALFKI 03/10/1997 09/04/1998 188
ALFKI 13/10/1997 15/01/1998 94
ALFKI 13/10/1997 16/03/1998 154
ALFKI 13/10/1997 09/04/1998 178
ALFKI 15/01/1998 16/03/1998 60
ALFKI 15/01/1998 09/04/1998 84
…
So, do any of you have any ideas how I might achieve this? I know how to do it using a stored procedure, but I am trying to avoid that; I’d like to do this in a single query.
Thanks for any help you have to offer,
Regards,
Stephen.
SQL Server 2005:
SELECT a.CustomerID, a.OrderDate as Highdate, b.OrderDate as LowDate, DATEDIFF(day, a.OrderDate, b.OrderDate) AS Diffs
FROM (SELECT CustomerID, OrderDate, ROW_Number() OVER (Partition By CustomerID ORDER BY OrderDate) as RowNum FROM dbo.Orders) a
INNER JOIN (SELECT CustomerID, OrderDate, (ROW_Number() OVER (Partition By CustomerID ORDER BY OrderDate) -1)as RowNumMinusOne
FROM dbo.Orders) b ON a.CustomerID=b.CustomerId AND a.RowNum=b.RownumMinusOne
|||SQL Server 2000:
SELECT a.CustomerID, a.OrderDate as HighDate, b.OrderDate as lowDate, DATEDIFF(day, a.OrderDate, b.OrderDate) AS Diffs FROM (SELECT CustomerID, OrderDate, (select count(*) From Orders where CustomerID = T.CustomerID and OrderDate < T.OrderDate ) + 1 as Rank1
from Orders as T ) a INNER JOIN (SELECT CustomerID, OrderDate, (select count(*) From Orders where CustomerID = T1.CustomerID and OrderDate < T1.OrderDate ) as Rank2
from Orders as T1 ) b ON b.CustomerID=a.CustomerID and a.Rank1=b.Rank2
ORDER BY a.CustomerID, a.OrderDate
|||You're an absolute star! Just what I was after. My head was starting to spin trying to figure this one out.
Thank you for your help!
Regards,
Stephen.
sqldifference between dates
I have two problems.
1)I'm using datediff function to count difference in minutes between
two dates - and it's working fine.
But I would like to ask if there is any function (or maybe U could tell
me how to do it) that is able to count difference between two dates in
minutes, including only days from Monday to Friday and hours from 9:00
am to 5:15 pm.
2)My second question reference to the first one. Let's suppose that
I've managed to count correctly difference between two dates. But for
example: 120332 minutes is not telling me a lot. So I would like to
show this measure in this format DD:HH:MM
(DaysDays:HoursHours:MinutesMinutes) - aggregation function for this
measure is SUM.
I was trying to use MDX language to change 120332 into DD:HH:MM and
show this result in report but it didn't work - I don't know how
to do it correctly. Or maybe U have a better idea how I should do it.
Here's an approach to the 2nd problem - that of formatting minutes as DD:HH:MM
>>
With
Member [Measures].[TimeInMins] as
120332, FORMAT_STRING = '#,#'
Member [Measures].[TimeDD] as
Format(Int([Measures].[TimeInMins]/1440),
"#:")
Member [Measures].[TimeHHMM] as
Format(TimeSerial(0, [Measures].[TimeInMins] -
(Int([Measures].[TimeInMins]/1440) * 1440), 0),
"HH:mm")
Member [Measures].[TimeFormatted] as
[Measures].[TimeDD] + [Measures].[TimeHHMM]
select {[Measures].[TimeInMins],
[Measures].[TimeFormatted]} on 0
from [Adventure Works]
TimeInMins TimeFormatted
120,332 83:13:32
>>
This article discusses how various values of FORMAT_STRING work:
http://windowssdk.msdn.microsoft.com/en-us/library/ms718137.aspx
>>
Contents of FORMAT_STRING
The FORMAT_STRING property contains a format string that was used to generate the FORMATTED_VALUE property. The contents of FORMAT_STRING vary, depending on the data type of the value.
...
>>
|||Thanks for help!!!Here is code of working function (in sql server 2005):
MEMBER Measures.Time AS
right("0" + CStr(Int((Int(ET/60))/24)), 2)+ ":"
+ right("0" + CStr(Int(ET/60)-(Int((Int(ET/60))/24))*24), 2)+ ":"
+ right("0" + CStr(ET - (Int((Int(ET/60))/24)*24 + Int(Int(ET/60)-(Int((Int(ET/60))/24))*24))*60 ),2)
And to the first problem i wrote a TSQL function (maybe it isn't the best way - but for my problem is ok ;) )
DECLARE kursor CURSOR FOR
SELECT Case_number_, Arrival_Time, Closed_Time, datediff(day,Arrival_Time,Closed_Time) as roznica FROM data
DECLARE @.Case_number nvarchar(15)
DECLARE @.Arrival_Time datetime
DECLARE @.Closed_Time datetime
DECLARE @.Arrival_Time_help datetime
DECLARE @.Time_begin nvarchar(6)
DECLARE @.Time_end nvarchar(6)
DECLARE @.number_days int
DECLARE @.counter int
DECLARE @.no_weekend int
DECLARE @.dzien nvarchar(15)
DECLARE @.Resolved_Time int
DECLARE @.help_value int
OPEN kursor
FETCH NEXT FROM kursor INTO @.Case_number, @.Arrival_Time, @.Closed_Time, @.number_days
WHILE (@.@.FETCH_STATUS=0)
BEGIN
SET @.number_days =@.number_days +1
SET @.counter=@.number_days
SET @.Arrival_Time_help=@.Arrival_time
WHILE (@.counter>0)
BEGIN
SET @.dzien=datename(weekday,@.Arrival_Time_help)
if(@.dzien='Saturday' or @.dzien='Sunday')
BEGIN
SET @.number_days=@.number_days-1
END
SET @.Arrival_Time_help=DATEADD(day,1,@.Arrival_Time_help)
SET @.counter= @.counter-1
END
SET @.Resolved_Time=0
if(@.number_days=1)
SET @.Resolved_Time=datediff(mi,@.Arrival_Time,@.Closed_Time)
else
BEGIN
SET @.Time_begin=datename(hh,@.arrival_time)+':'+datename(mi,@.arrival_time)
SET @.Time_end='17:15'
SET @.help_value=datediff(mi,@.time_begin, @.time_end)
if(@.help_value>0)
SET @.Resolved_Time=@.help_value
SET @.Time_begin='9:00'
SET @.Time_end=datename(hh,@.Closed_time)+':'+datename(mi,@.Closed_time)
SET @.help_value=datediff(mi,@.time_begin, @.time_end)
if(@.help_value>0)
SET @.Resolved_Time=@.Resolved_Time+@.help_value
END
if(@.number_days>2)
BEGIN
SET @.Resolved_Time=@.Resolved_Time+(@.number_days-2)*495
END
UPDATE data set
Time_Period = @.Resolved_Time
WHERE Case_number_=@.Case_number
FETCH NEXT FROM kursor INTO @.Case_number, @.Arrival_Time, @.Closed_Time, @.number_days
END
CLOSE kursor
DEALLOCATE kursor
difference between dates
I have two problems.
1)I'm using datediff function to count difference in minutes between
two dates - and it's working fine.
But I would like to ask if there is any function (or maybe U could tell
me how to do it) that is able to count difference between two dates in
minutes, including only days from Monday to Friday and hours from 9:00
am to 5:15 pm.
2)My second question reference to the first one. Let's suppose that
I've managed to count correctly difference between two dates. But for
example: 120332 minutes is not telling me a lot. So I would like to
show this measure in this format DD:HH:MM
(DaysDays:HoursHours:MinutesMinutes) - aggregation function for this
measure is SUM.
I was trying to use MDX language to change 120332 into DD:HH:MM and
show this result in report but it didn't work - I don't know how
to do it correctly. Or maybe U have a better idea how I should do it.
Here's an approach to the 2nd problem - that of formatting minutes as DD:HH:MM
>>
With
Member [Measures].[TimeInMins] as
120332, FORMAT_STRING = '#,#'
Member [Measures].[TimeDD] as
Format(Int([Measures].[TimeInMins]/1440),
"#:")
Member [Measures].[TimeHHMM] as
Format(TimeSerial(0, [Measures].[TimeInMins] -
(Int([Measures].[TimeInMins]/1440) * 1440), 0),
"HH:mm")
Member [Measures].[TimeFormatted] as
[Measures].[TimeDD] + [Measures].[TimeHHMM]
select {[Measures].[TimeInMins],
[Measures].[TimeFormatted]} on 0
from [Adventure Works]
TimeInMins TimeFormatted
120,332 83:13:32
>>
This article discusses how various values of FORMAT_STRING work:
http://windowssdk.msdn.microsoft.com/en-us/library/ms718137.aspx
>>
Contents of FORMAT_STRING
The FORMAT_STRING property contains a format string that was used to generate the FORMATTED_VALUE property. The contents of FORMAT_STRING vary, depending on the data type of the value.
...
>>
|||Thanks for help!!!Here is code of working function (in sql server 2005):
MEMBER Measures.Time AS
right("0" + CStr(Int((Int(ET/60))/24)), 2)+ ":"
+ right("0" + CStr(Int(ET/60)-(Int((Int(ET/60))/24))*24), 2)+ ":"
+ right("0" + CStr(ET - (Int((Int(ET/60))/24)*24 + Int(Int(ET/60)-(Int((Int(ET/60))/24))*24))*60 ),2)
And to the first problem i wrote a TSQL function (maybe it isn't the best way - but for my problem is ok ;) )
DECLARE kursor CURSOR FOR
SELECT Case_number_, Arrival_Time, Closed_Time, datediff(day,Arrival_Time,Closed_Time) as roznica FROM data
DECLARE @.Case_number nvarchar(15)
DECLARE @.Arrival_Time datetime
DECLARE @.Closed_Time datetime
DECLARE @.Arrival_Time_help datetime
DECLARE @.Time_begin nvarchar(6)
DECLARE @.Time_end nvarchar(6)
DECLARE @.number_days int
DECLARE @.counter int
DECLARE @.no_weekend int
DECLARE @.dzien nvarchar(15)
DECLARE @.Resolved_Time int
DECLARE @.help_value int
OPEN kursor
FETCH NEXT FROM kursor INTO @.Case_number, @.Arrival_Time, @.Closed_Time, @.number_days
WHILE (@.@.FETCH_STATUS=0)
BEGIN
SET @.number_days =@.number_days +1
SET @.counter=@.number_days
SET @.Arrival_Time_help=@.Arrival_time
WHILE (@.counter>0)
BEGIN
SET @.dzien=datename(weekday,@.Arrival_Time_help)
if(@.dzien='Saturday' or @.dzien='Sunday')
BEGIN
SET @.number_days=@.number_days-1
END
SET @.Arrival_Time_help=DATEADD(day,1,@.Arrival_Time_help)
SET @.counter= @.counter-1
END
SET @.Resolved_Time=0
if(@.number_days=1)
SET @.Resolved_Time=datediff(mi,@.Arrival_Time,@.Closed_Time)
else
BEGIN
SET @.Time_begin=datename(hh,@.arrival_time)+':'+datename(mi,@.arrival_time)
SET @.Time_end='17:15'
SET @.help_value=datediff(mi,@.time_begin, @.time_end)
if(@.help_value>0)
SET @.Resolved_Time=@.help_value
SET @.Time_begin='9:00'
SET @.Time_end=datename(hh,@.Closed_time)+':'+datename(mi,@.Closed_time)
SET @.help_value=datediff(mi,@.time_begin, @.time_end)
if(@.help_value>0)
SET @.Resolved_Time=@.Resolved_Time+@.help_value
END
if(@.number_days>2)
BEGIN
SET @.Resolved_Time=@.Resolved_Time+(@.number_days-2)*495
END
UPDATE data set
Time_Period = @.Resolved_Time
WHERE Case_number_=@.Case_number
FETCH NEXT FROM kursor INTO @.Case_number, @.Arrival_Time, @.Closed_Time, @.number_days
END
CLOSE kursor
DEALLOCATE kursor
Sunday, February 19, 2012
Developer cant handle dates
Or is there a method they are suppose to be using
I had to remove my modified date check to check for data collisions because they can't pass back microseconds.
What's the dealDepending on which of the .NET languages is being used, and in most of them which data type is being used, temporal data can be stored to the day, second, or true millisecond (which is actually more precise than SQL Server can store).
The short answer becomes something like: If you want absolute portability, convert and send them text (character) data. If they are using C#, C++, or VB then they just have to choose the correct data type. Most of the other .NET languages can store times to millieconds, but depending on the language that can be a pain in the patoot.
-PatP|||This dodges the obvious bullet about most developers not being able to even get a date, much less handle one! ;)
-PatP|||i thought this was a craigslist post.|||OK, CONVERT it is
And why is sql server limited in th MS category?
Something about clock speed?