Viewing 15 posts - 2,866 through 2,880 (of 3,008 total)
That code would produce an error if the dateformat in non-US, for example dmy is normal in UK.
April 4, 2007 at 10:22 am
I think you have a typo. This will do what you want.
select dateadd(dd,datediff(dd,0,getdate()),0)
April 4, 2007 at 10:17 am
More than likely, you are getting this problem because you have a computed column or indexed view on a table. There are specific options that have to be set correctly with...
April 4, 2007 at 9:58 am
What if you didn't know anything about Muppets? I guess you wouldn't get the job.
If someone asked me that question, I would take it as a sign that they were...
April 4, 2007 at 9:14 am
This should do it.
select ReadOnly = databaseproperty(a.name ,'IsReadOnly'), a.name from master.dbo.sysdatabases a order by a.name
April 3, 2007 at 3:15 pm
You could have them insert their query results in declared tables ( declare @t table (...col defs...) ) first before returning any data to the client so there are no issues with locks.
April 2, 2007 at 1:30 pm
This seems simpler and looks like it works OK.
select [DateTime] = convert(datetime,substring(MyDate,1,8))+ -- Add hours dateadd(hh,0+substring(MyDate,9,2),0)+ -- Add minutes dateadd(mi,0+substring(MyDate,11,2),0)+ -- Add seconds dateadd(ss,0+substring(MyDate,13,2),0)+ -- Add millseconds, and right fill with zeros dateadd(ms,0+left(substring(MyDate,15,3)+'000',3),0) from (-- Test Data Select Mydate = '20071221234455' union all Select Mydate...
March 30, 2007 at 12:31 pm
SQL Server generates the account and password, and you cannot set either.
The account is a local account on the SQL Server, and so is limited to access to the local server...
March 30, 2007 at 9:25 am
Just type in the URL of the network directory.
March 29, 2007 at 9:26 pm
March 29, 2007 at 9:21 pm
select Hours = datediff(ms,T1,T2)/3600000.000 from (selectT1 = convert(datetime,'15:01:00'), T2 = convert(datetime,'18:00:00') ) a
Result:
Hours -------------------------- 2.98333333333
(1 row(s) affected)
March 29, 2007 at 9:13 pm
Project Life Cycle
1. Set delivery date.
2. Code until the day before the delivery date.
3. Do some half-assed testing.
4. If test results are good then go live else go live.
5. Declare...
March 29, 2007 at 9:01 pm
This wasn't an April Fool joke; we did this as a welcome back from vacation for a "friend".
We replaced the doorway of their cubical with a solid wall section so there was...
March 29, 2007 at 8:46 pm
If they do, it must not be very common. YYYY-MM-DD is the ISO standard.
select dateformat, count(*) from master.dbo.syslanguages group by dateformat
dateformat ---------- ----------- dmy 23 mdy 1 ymd 9
(3 row(s) affected)
March 27, 2007 at 6:59 pm
Viewing 15 posts - 2,866 through 2,880 (of 3,008 total)